SpecFlowPlus Task behind proxy
I'm using the Azure DevOps SpecFlowPlus task in my pipeline to upload the Specflow test results to the SpecFlow+ LivingDoc extension. Everything worked fine while using Microsoft hosted agents in the cloud. But due to a policy I now have to use self-hosted build agents which are behind a proxy with self-signed certificates, which creates problems.
Without further configuration the task has this output:
Starting: Update Specflow LivingDoc ============================================================================== Task : SpecFlow+LivingDoc Description : Generate living documentation from your feature files or test assembly. Version : 0.6.964 Author : techtalk Help : https://docs.specflow.org/projects/specflow-livingdoc/en/latest/Generating/Adding-a-Build-Step.html ============================================================================== ##[error]Error: unable to get local issuer certificate at TLSSocket.onConnectSecure (_tls_wrap.js:1088:34) at TLSSocket.emit (events.js:198:13) at TLSSocket._finishInit (_tls_wrap.js:666:8) ##[error]The operation was canceled. Finishing: Update Specflow LivingDoc
Since I saw no option to disable SSL checks for the task itself, I tried to set the environment variable NODE_TLS_REJECT_UNAUTHORIZED which helps with Node-related tasks, and it also seems to do the trick here.
- task: SpecFlowPlus@0 env: NODE_TLS_REJECT_UNAUTHORIZED: 0 displayName: 'Update Specflow LivingDoc' inputs: generatorSource: 'TestAssembly' testAssemblyFilePath: '$(Build.BinariesDirectory)/My.Test.dll' projectName: 'MyProject' testExecutionJson: '$(Build.BinariesDirectory)/TestExecution.json' projectLanguage: 'en' timeoutInMinutes: 5
This indeed uploads the test results so that they are visible in the SpecFlow+ LivingDoc extension. But despite that, the problem now is that the SpecFlowPlus task never finishes and times out after 5 minutes which leads to a red/failed build (or orange/warning build with
continueOnError: true). This never happened on Microsoft hosted agents.
Starting: Update Specflow LivingDoc ============================================================================== Task : SpecFlow+LivingDoc Description : Generate living documentation from your feature files or test assembly. Version : 0.6.964 Author : techtalk Help : https://docs.specflow.org/projects/specflow-livingdoc/en/latest/Generating/Adding-a-Build-Step.html ============================================================================== Uploading: 386 bytes Uploading: 147943 bytes Upload was successful. ##[error]The operation was canceled. Finishing: Update Specflow LivingDoc
My goal is to have a green/successful build if the upload finishes.
Any ideas what this is and what I can do?
Please sign in to leave a comment.