Genetec / azure-devops-extension-publishtestresultscreenshot

Azure DevOps extension used in CI pipeline to upload screenshot in test results report.
https://marketplace.visualstudio.com/items?itemName=Genetec.publish-test-result-screenshot
Apache License 2.0
10 stars 6 forks source link

Add support for Release pipelines #3

Closed JG127 closed 2 months ago

JG127 commented 4 years ago

Agent pool: Hosted Azure Pipeline, release pipelines Agent specification: ubuntu Context: Pyhon Selene tests Test result format: jUnit, generated by unittest-xml-reporting

Describe the bug The task fails with a single error message "Cannot read property 'length' of null"

To Reproduce Steps to reproduce the behavior:

  1. Add the task right after "Publish Test Results" task
  2. Set the name of the organisation, one word of eight characters.
  3. Set the path to "$(System.DefaultWorkingDirectory)/test_results".
  4. Run the release pipeline

Expected behavior The png files in "$(System.DefaultWorkingDirectory)/test_results" are present in the test run. As advertised.

Unfortunately I couldn't find anything more detailed than the task log:

2020-09-04T16:03:16.6261975Z ##[section]Starting: Publish screenshot
2020-09-04T16:03:16.6269610Z ==============================================================================
2020-09-04T16:03:16.6270109Z Task         : Publish screenshots for test failure
2020-09-04T16:03:16.6270626Z Description  : Get more insight on your test failures with contextual screenshots.
2020-09-04T16:03:16.6271037Z Version      : 0.1.0
2020-09-04T16:03:16.6271341Z Author       : Genetec
2020-09-04T16:03:16.6272436Z Help         : https://github.com/Genetec/azure-devops-extension-publishtestresultscreenshot/issues
2020-09-04T16:03:16.6273040Z ==============================================================================
2020-09-04T16:03:17.4087552Z ##[error]Cannot read property 'length' of null
2020-09-04T16:03:17.4127763Z ##[section]Finishing: Publish screenshot
eric-labelle commented 4 years ago

Could you please paste an updated version of the logs after running your pipeline with the "Enable system diagnostics" checked? Might have more insight on the error. Thanks

JG127 commented 4 years ago

Hello Eric,

Thank you for having a look to this. Release pipelines don't have this checkbox. But when setting System.Debug to true the same output is given. Maybe that's the issue - a release pipeline instead of a build pipeline ?

2020-09-08T14:12:42.1312516Z ##[debug]Evaluating condition for step: 'Publish Test Results'
2020-09-08T14:12:42.1313235Z ##[debug]Evaluating: succeeded()
2020-09-08T14:12:42.1313579Z ##[debug]Evaluating succeeded:
2020-09-08T14:12:42.1314006Z ##[debug]=> True
2020-09-08T14:12:42.1314333Z ##[debug]Result: True
2020-09-08T14:12:42.1314707Z ##[section]Starting: Publish Test Results
2020-09-08T14:12:42.1319485Z ==============================================================================
2020-09-08T14:12:42.1319734Z Task         : Publish Test Results
2020-09-08T14:12:42.1319950Z Description  : Publish test results to Azure Pipelines
2020-09-08T14:12:42.1320165Z Version      : 2.171.0
2020-09-08T14:12:42.1320339Z Author       : Microsoft Corporation
2020-09-08T14:12:42.1320609Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
2020-09-08T14:12:42.1320946Z ==============================================================================
2020-09-08T14:12:42.2445280Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2020-09-08T14:12:42.2467714Z ##[debug]loading inputs and endpoints
2020-09-08T14:12:42.2470096Z ##[debug]loading INPUT_TESTRUNNER
2020-09-08T14:12:42.2478652Z ##[debug]loading INPUT_TESTRESULTSFILES
2020-09-08T14:12:42.2481199Z ##[debug]loading INPUT_SEARCHFOLDER
2020-09-08T14:12:42.2482086Z ##[debug]loading INPUT_MERGETESTRESULTS
2020-09-08T14:12:42.2483158Z ##[debug]loading INPUT_FAILTASKONFAILEDTESTS
2020-09-08T14:12:42.2483858Z ##[debug]loading INPUT_PUBLISHRUNATTACHMENTS
2020-09-08T14:12:42.2484685Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2020-09-08T14:12:42.2485561Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2020-09-08T14:12:42.2486603Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2020-09-08T14:12:42.2490517Z ##[debug]loaded 9
2020-09-08T14:12:42.2504452Z ##[debug]Agent.ProxyUrl=undefined
2020-09-08T14:12:42.2506135Z ##[debug]Agent.CAInfo=undefined
2020-09-08T14:12:42.2506591Z ##[debug]Agent.ClientCert=undefined
2020-09-08T14:12:42.2506961Z ##[debug]Agent.SkipCertValidation=undefined
2020-09-08T14:12:42.2542682Z ##[debug]check path : /home/vsts/work/_tasks/PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1/2.171.0/task.json
2020-09-08T14:12:42.2543793Z ##[debug]adding resource file: /home/vsts/work/_tasks/PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1/2.171.0/task.json
2020-09-08T14:12:42.2544537Z ##[debug]system.culture=en-US
2020-09-08T14:12:42.2558645Z ##[debug]testRunner=JUnit
2020-09-08T14:12:42.2563582Z ##[debug]testResultsFiles=**/TEST-*.xml
2020-09-08T14:12:42.2565397Z ##[debug]mergeTestResults=true
2020-09-08T14:12:42.2565895Z ##[debug]platform=null
2020-09-08T14:12:42.2566274Z ##[debug]configuration=null
2020-09-08T14:12:42.2566631Z ##[debug]testRunTitle=null
2020-09-08T14:12:42.2567048Z ##[debug]publishRunAttachments=true
2020-09-08T14:12:42.2567446Z ##[debug]failTaskOnFailedTests=true
2020-09-08T14:12:42.2567897Z ##[debug]searchFolder=/home/vsts/work/r1/a/test_results
2020-09-08T14:12:42.2568301Z ##[debug]testRunner: JUnit
2020-09-08T14:12:42.2569091Z ##[debug]testResultsFiles: **/TEST-*.xml
2020-09-08T14:12:42.2569529Z ##[debug]mergeResults: true
2020-09-08T14:12:42.2570068Z ##[debug]platform: null
2020-09-08T14:12:42.2570429Z ##[debug]config: null
2020-09-08T14:12:42.2570796Z ##[debug]testRunTitle: null
2020-09-08T14:12:42.2571206Z ##[debug]publishRunAttachments: true
2020-09-08T14:12:42.2571615Z ##[debug]failTaskOnFailedTests: true
2020-09-08T14:12:42.2572087Z ##[debug]System.DefaultWorkingDirectory=/home/vsts/work/r1/a
2020-09-08T14:12:42.2575627Z ##[debug]defaultRoot: '/home/vsts/work/r1/a/test_results'
2020-09-08T14:12:42.2576262Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'true'
2020-09-08T14:12:42.2576844Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2020-09-08T14:12:42.2577434Z ##[debug]findOptions.followSymbolicLinks: 'true'
2020-09-08T14:12:42.2577992Z ##[debug]matchOptions.debug: 'false'
2020-09-08T14:12:42.2578611Z ##[debug]matchOptions.nobrace: 'true'
2020-09-08T14:12:42.2579133Z ##[debug]matchOptions.noglobstar: 'false'
2020-09-08T14:12:42.2579912Z ##[debug]matchOptions.dot: 'true'
2020-09-08T14:12:42.2580416Z ##[debug]matchOptions.noext: 'false'
2020-09-08T14:12:42.2580938Z ##[debug]matchOptions.nocase: 'false'
2020-09-08T14:12:42.2581451Z ##[debug]matchOptions.nonull: 'false'
2020-09-08T14:12:42.2581990Z ##[debug]matchOptions.matchBase: 'false'
2020-09-08T14:12:42.2582586Z ##[debug]matchOptions.nocomment: 'false'
2020-09-08T14:12:42.2583130Z ##[debug]matchOptions.nonegate: 'false'
2020-09-08T14:12:42.2584181Z ##[debug]matchOptions.flipNegate: 'false'
2020-09-08T14:12:42.2584731Z ##[debug]pattern: '**/TEST-*.xml'
2020-09-08T14:12:42.2608839Z ##[debug]findPath: '/home/vsts/work/r1/a/test_results'
2020-09-08T14:12:42.2609584Z ##[debug]statOnly: 'false'
2020-09-08T14:12:42.2610769Z ##[debug]findPath: '/home/vsts/work/r1/a/test_results'
2020-09-08T14:12:42.2612342Z ##[debug]findOptions.allowBrokenSymbolicLinks: 'true'
2020-09-08T14:12:42.2612775Z ##[debug]findOptions.followSpecifiedSymbolicLink: 'true'
2020-09-08T14:12:42.2613184Z ##[debug]findOptions.followSymbolicLinks: 'true'
2020-09-08T14:12:42.2614341Z ##[debug]  /home/vsts/work/r1/a/test_results (directory)
2020-09-08T14:12:42.2619875Z ##[debug]  /home/vsts/work/r1/a/test_results/1599574345991.html (file)
2020-09-08T14:12:42.2620462Z ##[debug]  /home/vsts/work/r1/a/test_results/1599574345991.png (file)
2020-09-08T14:12:42.2620989Z ##[debug]  /home/vsts/work/r1/a/test_results/TEST-results.xml (file)
2020-09-08T14:12:42.2621320Z ##[debug]4 results
2020-09-08T14:12:42.2621568Z ##[debug]found 4 paths
2020-09-08T14:12:42.2621837Z ##[debug]applying include pattern
2020-09-08T14:12:42.2622299Z ##[debug]adjustedPattern: '/home/vsts/work/r1/a/test_results/**/TEST-*.xml'
2020-09-08T14:12:42.2629216Z ##[debug]1 matches
2020-09-08T14:12:42.2633649Z ##[debug]1 final results
2020-09-08T14:12:42.2633938Z ##[debug]Detected 1 test result files
2020-09-08T14:12:42.2636235Z ##[debug]which 'dotnet'
2020-09-08T14:12:42.2641783Z ##[debug]found: '/usr/bin/dotnet'
2020-09-08T14:12:42.2642474Z ##[debug]which '/usr/bin/dotnet'
2020-09-08T14:12:42.2644120Z ##[debug]found: '/usr/bin/dotnet'
2020-09-08T14:12:42.2644480Z ##[debug]which '/usr/bin/dotnet'
2020-09-08T14:12:42.2644813Z ##[debug]found: '/usr/bin/dotnet'
2020-09-08T14:12:42.2647198Z ##[debug]/usr/bin/dotnet arg: --version
2020-09-08T14:12:42.2650735Z ##[debug]exec tool: /usr/bin/dotnet
2020-09-08T14:12:42.2651007Z ##[debug]arguments:
2020-09-08T14:12:42.2651331Z ##[debug]   --version
2020-09-08T14:12:42.2654090Z [command]/usr/bin/dotnet --version
2020-09-08T14:12:44.0461362Z 3.1.401
2020-09-08T14:12:44.0463239Z ##[debug]PublishTestResults.OverrideExeFlow=undefined
2020-09-08T14:12:44.0463738Z ##[debug]OS type: Linux
2020-09-08T14:12:44.7677896Z ##[debug]Failed to get FF TestManagement.Server.EnableHierarchicalResult Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.EnableHierarchicalResult)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.EnableHierarchicalResult
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.8021714Z ##[debug]Failed to get FF TestManagement.Server.EnableHierarchicalResultAttachment Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.EnableHierarchicalResultAttachment)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.EnableHierarchicalResultAttachment
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.8350155Z ##[debug]Failed to get FF WebAccess.TestManagement.LinkedStackTrace Value, exception message System.AggregateException: One or more errors occurred. (WebAccess.TestManagement.LinkedStackTrace)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: WebAccess.TestManagement.LinkedStackTrace
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.8709448Z ##[debug]Failed to get FF TestManagement.Server.TestLogStoreOnTCMService Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.TestLogStoreOnTCMService)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.TestLogStoreOnTCMService
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.9023698Z ##[debug]Failed to get FF TestManagement.Server.PublishOnTestLogStoreEnabled Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.PublishOnTestLogStoreEnabled)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.PublishOnTestLogStoreEnabled
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.9421780Z ##[debug]Failed to get FF TestManagement.Server.TestLogStoreTelemetryDisabledFF Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.TestLogStoreTelemetryDisabledFF)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.TestLogStoreTelemetryDisabledFF
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:44.9434823Z ##[debug]Object of TestLogStore created.
2020-09-08T14:12:44.9438956Z Result Attachments will be stored in FileService
2020-09-08T14:12:44.9439947Z ##[debug]Object of TestResultsPublisher created.
2020-09-08T14:12:44.9764129Z ##[debug]Failed to get FF TestManagement.Server.ParserAndPublisherTelemetryEnabledFF Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.ParserAndPublisherTelemetryEnabledFF)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.ParserAndPublisherTelemetryEnabledFF
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.0084261Z ##[debug]Failed to get FF TestManagement.Server.TestLogStoreOnTCMService Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.TestLogStoreOnTCMService)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.TestLogStoreOnTCMService
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.0417844Z ##[debug]Failed to get FF TestManagement.Server.PublishOnTestLogStoreEnabled Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.PublishOnTestLogStoreEnabled)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.PublishOnTestLogStoreEnabled
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.0428228Z ##[debug]Object of TestLogStore created.
2020-09-08T14:12:45.0430734Z Run Attachments will be stored in FileService
2020-09-08T14:12:45.0756523Z ##[debug]Failed to get FF TestManagement.Server.ParserAndPublisherTelemetryEnabledFF Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.ParserAndPublisherTelemetryEnabledFF)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.ParserAndPublisherTelemetryEnabledFF
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.0767422Z ##[debug]Object of TestRunPublisher created.
2020-09-08T14:12:45.1085289Z ##[debug]Failed to get FF TestManagement.Server.TestLogStoreOnTCMService Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.TestLogStoreOnTCMService)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.TestLogStoreOnTCMService
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.1404877Z ##[debug]Failed to get FF TestManagement.Server.PublishOnTestLogStoreEnabled Value, exception message System.AggregateException: One or more errors occurred. (TestManagement.Server.PublishOnTestLogStoreEnabled)
 ---> Microsoft.VisualStudio.Services.Common.VssServiceException: TestManagement.Server.PublishOnTestLogStoreEnabled
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable`1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable`1 queryParameters, Object userState, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at Microsoft.TeamFoundation.TestClient.PublishTestResults.PublishTestResultsCacheManager.TryGetFeatureFlagStateFromService(FeatureAvailabilityHttpClient featureAvailabilityHttpClient, String FFName, Boolean& featureFlagState)
2020-09-08T14:12:45.1410380Z ##[debug]Object of TestLogStore created.
2020-09-08T14:12:45.2778920Z ##[debug]Object of JUnitResultParser created.
2020-09-08T14:12:45.2786339Z ##[debug]Entering ParseTestResultFiles
2020-09-08T14:12:45.2788972Z ##[debug]runContext.Platform is null
2020-09-08T14:12:45.2789769Z ##[debug]runContext.Configuration is null
2020-09-08T14:12:45.2791736Z ##[debug]runContext.BuildURI is null
2020-09-08T14:12:45.2810028Z ##[debug]Reading test results from file '/home/vsts/work/r1/a/test_results/TEST-results.xml'.
2020-09-08T14:12:45.2899907Z ##[debug]Total test results: 1.
2020-09-08T14:12:45.2925536Z ##[debug]Leaving ParseTestResultFiles
2020-09-08T14:12:45.2947902Z ##[debug]Processed: ##vso[results.publish type=JUnit;mergeResults=true;publishRunAttachments=true;resultFiles=/home/vsts/work/r1/a/test_results/TEST-results.xml;failTaskOnFailedTests=true;testRunSystem=VSTS - PTR;]
2020-09-08T14:12:45.2948969Z ##[debug]task result: Succeeded
2020-09-08T14:12:45.2951969Z ##[debug]Processed: ##vso[task.complete result=Succeeded;]
2020-09-08T14:12:45.2953046Z ##[debug]Release.ReleaseUri=vstfs:///ReleaseManagement/Release/431
2020-09-08T14:12:45.2953728Z ##[debug]Release.ReleaseId=431
2020-09-08T14:12:45.2954300Z ##[debug]Build.BuildUri=undefined
2020-09-08T14:12:45.2954964Z ##[debug]Build.Buildid=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-08T14:12:45.2969551Z ##[debug]Uploading build level attachements individually
2020-09-08T14:12:45.3032492Z ##[debug]runContext.Platform is null
2020-09-08T14:12:45.3034510Z ##[debug]runContext.Configuration is null
2020-09-08T14:12:45.3036369Z ##[debug]runContext.BuildURI is null
2020-09-08T14:12:45.3057717Z ##[debug]Entering PublishAllTestResultsToSingleTestRunAsync
2020-09-08T14:12:45.3336654Z ##[debug]Entering CreateTestRunAsync
2020-09-08T14:12:45.3338570Z ##[debug]Leaving CreateTestRunAsync
2020-09-08T14:12:45.3401978Z ##[debug]Processed: ##vso[telemetry.publish area=TestExecution;feature=PublishTestResultsTask]{"releaseuri":"vstfs:///ReleaseManagement/Release/431","releaseid":"431","buildid":"245d8353d0633fac2b914b1f8584354ac36ccb2f","osType":"Linux","testRunner":"JUnit","failTaskOnFailedTests":"true","mergeResultsUserPreference":"true","config":null,"platform":null,"testResultsFilesCount":1,"dotnetVersion":"3.1.401","subFeature":"publishTestResultsTaskConsolidatedCiEvent"}
2020-09-08T14:12:45.3431221Z ##[section]Async Command Start: Publish test results
2020-09-08T14:12:45.3851733Z ##[debug]Total build level attachments: 0.
2020-09-08T14:12:45.5314265Z ##[debug]Entering AddTestResultsAsync
2020-09-08T14:12:45.5691428Z Publishing test results to test run '2564'.
2020-09-08T14:12:45.5728806Z TestResults To Publish 1, Test run id:2564
2020-09-08T14:12:45.5766870Z Test results publishing 1, remaining: 0. Test run id: 2564
2020-09-08T14:12:45.8251926Z ##[debug]Leaving AddTestResultsAsync
2020-09-08T14:12:45.8280909Z ##[debug]Entering UpdateTestRunAsync
2020-09-08T14:12:45.8281202Z ##[debug]Leaving UpdateTestRunAsync
2020-09-08T14:12:45.9082114Z ##[debug]Entering CreateTestRunAttachmentsAsync
2020-09-08T14:12:45.9438817Z ##[debug]Leaving CreateTestRunAttachmentsAsync
2020-09-08T14:12:46.0575158Z Published Test Run : https://tfsprodweu3.visualstudio.com/Acc238bb7-326d-4869-a7f3-96876f9e92d4/DevOps/_TestManagement/Runs?runId=2564&_a=runCharts.
2020-09-08T14:12:46.0577517Z ##[debug]Leaving PublishAllTestResultsToSingleTestRunAsync
2020-09-08T14:12:46.0995904Z ##[debug]RESOURCE_URIS:
2020-09-08T14:12:46.1018337Z ##[debug]Setting task variable METADATA_c97e3ec0-4751-4353-a319-b9f848c9571f: {"name":"dedec3fc-93c0-474f-96a8-b62e3e237bb5","resourceUris":[],"metadata":{"description":"","relatedUrls":[{"url":"https://dev.azure.com/FooBar/DevOps/_releaseProgress?releaseId=431","label":"pipeline-url"}],"humanReadableName":"Test Results from Publish Test Results utility","serializedPayload":"{\"testId\":\"PublishTestResults\",\"testTool\":\"JUnit\",\"testResultAttestation\":{\"total\":1,\"failed\":1,\"passed\":0,\"skipped\":0},\"testDurationSeconds\":0.0,\"testPassPercentage\":\"0\",\"relatedUrls\":[{\"url\":\"https://dev.azure.com/FooBar/DevOps/_releaseProgress?releaseId=431\",\"label\":\"pipeline-url\"}]}"}} 
2020-09-08T14:12:46.3851584Z ##[debug]Entering IsTestRunFailed
2020-09-08T14:12:46.3852159Z TestRunPublisher.IsTestRunFailed: Getting test run summary with run id: 2564 using stats api
2020-09-08T14:12:46.4671728Z ##[debug]Entering IsTestRunFailed
2020-09-08T14:12:46.4672342Z TestRunPublisher.IsTestRunFailed: checking if test run is failed using run summary input
2020-09-08T14:12:46.4672973Z Number of failed tests which are non-flaky is: 1
2020-09-08T14:12:46.4715473Z Failed Results are published
2020-09-08T14:12:46.4721223Z ##[error]There are one or more test failures detected in result files. Detailed summary of published test results can be viewed in the Tests tab.
2020-09-08T14:12:46.5001402Z ##[section]Async Command End: Publish test results
2020-09-08T14:12:46.5003234Z ##[section]Finishing: Publish Test Results
eric-labelle commented 4 years ago

Thanks for the logs @JG127 . I thought I had specified in the README or my medium article that I only tested this task in a real pipeline. I never tested on release pipelines but I don't see why it wouldn't work as extensions are built for both from what I can remember. The logs attached contains multiple warnings but these are the logs for the PublishTestResults task from microsoft, not the logs for our task PublishTestResultScreenshots.

JG127 commented 4 years ago

Ow ! My bad. Here it is:

2020-09-08T15:02:10.2452051Z ##[debug]Evaluating condition for step: 'Publish screenshot'
2020-09-08T15:02:10.2453766Z ##[debug]Evaluating: succeededOrFailed()
2020-09-08T15:02:10.2454514Z ##[debug]Evaluating succeededOrFailed:
2020-09-08T15:02:10.2457162Z ##[debug]=> True
2020-09-08T15:02:10.2457846Z ##[debug]Result: True
2020-09-08T15:02:10.2458374Z ##[section]Starting: Publish screenshot
2020-09-08T15:02:10.2464105Z ==============================================================================
2020-09-08T15:02:10.2464433Z Task         : Publish screenshots for test failure
2020-09-08T15:02:10.2464749Z Description  : Get more insight on your test failures with contextual screenshots.
2020-09-08T15:02:10.2465026Z Version      : 0.1.0
2020-09-08T15:02:10.2465208Z Author       : Genetec
2020-09-08T15:02:10.2465991Z Help         : https://github.com/Genetec/azure-devops-extension-publishtestresultscreenshot/issues
2020-09-08T15:02:10.2466371Z ==============================================================================
2020-09-08T15:02:10.3706222Z ##[debug]agent.TempDirectory=/home/vsts/work/_temp
2020-09-08T15:02:10.3729223Z ##[debug]loading inputs and endpoints
2020-09-08T15:02:10.3733490Z ##[debug]loading INPUT_ORGANIZATION
2020-09-08T15:02:10.3744721Z ##[debug]loading INPUT_SCREENSHOTFOLDER
2020-09-08T15:02:10.3747159Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2020-09-08T15:02:10.3748288Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2020-09-08T15:02:10.3749348Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2020-09-08T15:02:10.3754005Z ##[debug]loaded 5
2020-09-08T15:02:10.3768841Z ##[debug]Agent.ProxyUrl=undefined
2020-09-08T15:02:10.3769958Z ##[debug]Agent.CAInfo=undefined
2020-09-08T15:02:10.3770580Z ##[debug]Agent.ClientCert=undefined
2020-09-08T15:02:10.3771174Z ##[debug]Agent.SkipCertValidation=undefined
2020-09-08T15:02:10.5340129Z ##[debug]System.TeamProject=DevOps
2020-09-08T15:02:10.5369048Z ##[debug]SystemVssConnection auth param AccessToken = ***
2020-09-08T15:02:10.5369609Z ##[debug]organization=FooBar
2020-09-08T15:02:11.0514082Z ##[debug]Build.BuildId=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-08T15:02:11.2745072Z ##[debug]task result: Failed
2020-09-08T15:02:11.2749570Z ##[error]Cannot read property 'length' of null
2020-09-08T15:02:11.2751038Z ##[debug]Processed: ##vso[task.issue type=error;]Cannot read property 'length' of null
2020-09-08T15:02:11.2755913Z ##[debug]Processed: ##vso[task.complete result=Failed;]Cannot read property 'length' of null
2020-09-08T15:02:11.2794480Z ##[section]Finishing: Publish screenshot
eric-labelle commented 4 years ago

Thanks! Are you comfortable with cmdline? I would need the output from the following cURL command. (_make sure you're not posting the auth_token here, just the resulting json from the API_)

You'll need an authToken. Easiest way to get one is using the Azure CLI

Once installed you can do the following

// Login with a user account that has access to the test runs (it will open a browser tab and ask for login)
az login --allow-no-subscriptions

//Then grab the access_token using
az account get-access-token

//Then export it to a tmp variable that will be used with the cURL (replace _youAccessToken_ with your token)
export AZURE_TOKEN=yourAccessToken 

Now that you have you auth token, you should be able to execute the following command. I grabbed the params from your logs.

curl -X GET -H "Authorization: Bearer "$AZURE_TOKEN -H "Content-Type: application/json" https://dev.azure.com/FooBar/DevOps/_apis/test/Runs/2564/results?api-version=6.0&outcomes=3

When there is no failures it would returns an empty list of tests, but based on your logs, there should be one test failure from the call. {"count":0,"value":[]}

eric-labelle commented 4 years ago

Not sure about this one. That's the output from the REST api call? So you were able to get the access token using az account get-access-token ?! otherwise try az login without --allow-no-subscriptions but personally I have to put this additional option otherwise I get an error while login.

Using the error code you're not alone, but seems like it was an issue fixed a while ago, so perhaps something else related to your user or setup

JG127 commented 4 years ago

Here it is: Let me know if I redacted too much. I'm trying not to publish any id's and such.

{"count":1,"value":[{"id":100000,"project":{"id":"************","name":"DevOps","url":"https://dev.azure.com/FooBar/_apis/projects/DevOps"},"startedDate":"2020-09-08T14:12:41Z","completedDate":"2020-09-08T14:12:56.41Z","durationInMs":15410.0,"outcome":"Failed","revision":1,"state":"Completed","testCase":{"name":"test_simple"},"testRun":{"id":"2564","name":"JUnit_TestResults_0","url":"https://dev.azure.com/FooBar/DevOps/_apis/test/Runs/2564"},"lastUpdatedDate":"2020-09-08T14:12:45.63Z","priority":0,"errorMessage":"Message:   Timed out after 2s, while waiting for: browser.all(('css selector', '.srg .g')).has size 10  Reason: AssertionError: actual size: 0 Screenshot: file://test_results/1599574345991.png PageSource: file://test_results/1599574345991.html ","createdDate":"2020-09-08T14:12:45.63Z","url":"https://dev.azure.com/FooBar/DevOps/_apis/test/Runs/2564/Results/100000","failureType":"None","automatedTestStorage":"SimpleTest","automatedTestType":"JUnit","testCaseTitle":"test_simple","stackTrace":"Traceback (most recent call last):
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/wait.py\", line 98, in for_
    return fn(self._entity)
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/condition.py\", line 133, in __call__
    return self._fn(*args, **kwargs)
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/condition.py\", line 106, in fn
    raise AssertionError(f'actual {result}: {actual}')
AssertionError: actual size: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File \"/home/vsts/work/r1/a/_***********/tests/test_google.py\", line 24, in test_simple
    browser \\
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/entity.py\", line 1002, in should
    super().should(condition)
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/entity.py\", line 123, in should
    self.wait.for_(condition)
  File \"/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/site-packages/selene/core/wait.py\", line 117, in for_
    raise self._hook_failure(failure)
selene.core.exceptions.TimeoutException: Message: 

Timed out after 2s, while waiting for:
browser.all(('css selector', '.srg .g')).has size 10

Reason: AssertionError: actual size: 0
Screenshot: file://test_results/1599574345991.png
PageSource: file://test_results/1599574345991.html

","customFields":[],"failingSince":{"date":"2020-09-04T14:55:56.607Z","build":{"id":0,"definitionId":0,"branchName":""},"release":{"id":418,"name":"Release-20","environmentId":1067,"environmentName":null,"definitionId":0,"environmentDefinitionId":0,"environmentDefinitionName":null}},"releaseReference":{"id":431,"name":"Release-23","environmentId":1080,"environmentName":null,"definitionId":18,"environmentDefinitionId":49,"environmentDefinitionName":null},"testCaseReferenceId":359075315,"lastUpdatedBy":{"displayName":"Project Collection Build Service (FooBar)","url":"https://spsprodweu2.vssps.visualstudio.com/************/_apis/Identities/************","_links":{"avatar":{"href":"https://dev.azure.com/FooBar/_apis/GraphProfile/MemberAvatars/svc.M2FhOGIzNDEtZjM1OS00ZTY2LWJlOTItN2RhMWNiMjk4YWMxOkJ1aWxkOmNjMjM4YmI3LTMyNmQtNDg2OS1hN2YzLTk2ODc2ZjllOTJkNA"}},"id":"************","uniqueName":"Build\\************","imageUrl":"https://dev.azure.com/FooBar/_apis/GraphProfile/MemberAvatars/svc.M2FhOGIzNDEtZjM1OS00ZTY2LWJlOTItN2RhMWNiMjk4YWMxOkJ1aWxkOmNjMjM4YmI3LTMyNmQtNDg2OS1hN2YzLTk2ODc2ZjllOTJkNA","descriptor":"svc.M2FhOGIzNDEtZjM1OS00ZTY2LWJlOTItN2RhMWNiMjk4YWMxOkJ1aWxkOmNjMjM4YmI3LTMyNmQtNDg2OS1hN2YzLTk2ODc2ZjllOTJkNA"},"automatedTestName":"test_simple"}]}
eric-labelle commented 4 years ago

All right, thanks! So confirming this returns something leave me with 2 options:

  1. it's because it is ran in a Release Pipeline --> You could try to do the same in a Build Pipeline instead of a Release Pipeline to discard this option

  2. it's because it's triggered by a Github project (based on the {Build.BuildId} printed in your logs), and perhaps their Node API client does not support these.

Docs for Build.BuildId

Azure Pipelines example: 130 Jenkins/TeamCity example: 130 GitHub example: 38629c964d21fe405ef830b7d0220966b82c9e11 from: https://docs.microsoft.com/en-us/azure/devops/pipelines/release/variables?view=azure-devops&tabs=batch#default-variables---general-artifact

--> The task uses the MS Node API Client to fetch the test results. If we can isolate that the problem is with the api, then an issue on their project would be the next thing to do.

Not sure what your setup is, but I have no way to test this from a Github build and there is no Azure DevOps REST Api to try a curl using a BuildId rather than a RunId

Could you try in the pipeline to just do an printout of the predefined variables Build.BuildUri? Should be something like echo ${Build.BuildUri}. With devops it would return something like vstfs:///Build/Build/1430 but with a github project, I have no clues but your buildId is 245d8353d0633fac2b914b1f8584354ac36ccb2f so it should contains this value at least..

JG127 commented 4 years ago

I'm triggering it from an Azure Git repository, in the same project as the release pipeline. When the predefined branch of this repository is updated it means there a website deployed somewhere. I'm using this to trigger a release pipe running Selenium tests. In this particular case it's manually triggered.

I went for release pipelines because that's what they are meant for in this case. If I get the gist of Azure right the build pipelines are meant to build something. While the release pipelines are meant to release what has been built. Hence the names.

Instead of one variable, I've dumped it all just in case it can help you. I tried to redact the obvious references. :-)

2020-09-09T06:47:06.4524015Z AGENT_ACCEPTTEEEULA=True
2020-09-09T06:47:06.4526758Z AGENT_DISABLELOGPLUGIN_TESTFILEPUBLISHERPLUGIN=true
2020-09-09T06:47:06.4527155Z AGENT_DISABLELOGPLUGIN_TESTRESULTLOGPLUGIN=true
2020-09-09T06:47:06.4527449Z AGENT_HOMEDIRECTORY=/home/vsts/agents/2.174.1
2020-09-09T06:47:06.4527688Z AGENT_ID=8
2020-09-09T06:47:06.4527919Z AGENT_JOBNAME=Run on agent
2020-09-09T06:47:06.4528145Z AGENT_JOBSTATUS=Failed
2020-09-09T06:47:06.4528704Z AGENT_MACHINENAME=fv-az779
2020-09-09T06:47:06.4528972Z AGENT_NAME=Hosted Agent
2020-09-09T06:47:06.4529185Z AGENT_OS=Linux
2020-09-09T06:47:06.4529397Z AGENT_OSARCHITECTURE=X64
2020-09-09T06:47:06.4529648Z AGENT_RELEASEDIRECTORY=/home/vsts/work/r1/a
2020-09-09T06:47:06.4530083Z AGENT_RETAINDEFAULTENCODING=false
2020-09-09T06:47:06.4530336Z AGENT_ROOTDIRECTORY=/home/vsts/work
2020-09-09T06:47:06.4530600Z AGENT_TEMPDIRECTORY=/home/vsts/work/_temp
2020-09-09T06:47:06.4530888Z AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
2020-09-09T06:47:06.4531133Z AGENT_VERSION=2.174.1
2020-09-09T06:47:06.4531375Z AGENT_WORKFOLDER=/home/vsts/work
2020-09-09T06:47:06.4531645Z ANDROID_HOME=/usr/local/lib/android/sdk
2020-09-09T06:47:06.4531916Z ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
2020-09-09T06:47:06.4532167Z ANT_HOME=/usr/share/ant
2020-09-09T06:47:06.4532415Z AZURE_EXTENSION_DIR=/opt/az/azcliextensions
2020-09-09T06:47:06.4533197Z AZURE_HTTP_USER_AGENT=VSTS_cc238bb7-326d-4869-a7f3-96876f9e92d4_Release__439_1088_1
2020-09-09T06:47:06.4534324Z BUILD_BUILDID=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-09T06:47:06.4534683Z BUILD_BUILDNUMBER=245d8353
2020-09-09T06:47:06.4535436Z BUILD_DEFINITIONID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4535839Z BUILD_DEFINITIONNAME=git_repo
2020-09-09T06:47:06.4536403Z BUILD_DEFINTIONID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4537006Z BUILD_PROJECTID=26e0964e-87e4-4a88-acb5-c7bd32e139cf
2020-09-09T06:47:06.4537350Z BUILD_PROJECTNAME=DevOps
2020-09-09T06:47:06.4537877Z BUILD_REPOSITORY_ID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4538278Z BUILD_REPOSITORY_NAME=git_repo
2020-09-09T06:47:06.4538597Z BUILD_REPOSITORY_PROVIDER=Git
2020-09-09T06:47:06.4539009Z BUILD_REPOSITORY_URI=https://FooBar@dev.azure.com/FooBar/DevOps/_git/git_repo
2020-09-09T06:47:06.4539482Z BUILD_SOURCEBRANCH=master
2020-09-09T06:47:06.4539851Z BUILD_SOURCEVERSION=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-09T06:47:06.4540177Z BUILD_TYPE=Git
2020-09-09T06:47:06.4540475Z CHROMEWEBDRIVER=/usr/local/share/chrome_driver
2020-09-09T06:47:06.4540989Z CHROME_BIN=/usr/bin/google-chrome
2020-09-09T06:47:06.4541305Z CONDA=/usr/share/miniconda
2020-09-09T06:47:06.4541604Z DEBIAN_FRONTEND=noninteractive
2020-09-09T06:47:06.4541916Z DOTNET_MULTILEVEL_LOOKUP="0"
2020-09-09T06:47:06.4542190Z DOTNET_NOLOGO="1"
2020-09-09T06:47:06.4542480Z DOTNET_SKIP_FIRST_TIME_EXPERIENCE="1"
2020-09-09T06:47:06.4542887Z ENDPOINT_URL_SYSTEMVSSCONNECTION=https://vsrm.dev.azure.com/FooBar/
2020-09-09T06:47:06.4543299Z GECKOWEBDRIVER=/usr/local/share/gecko_driver
2020-09-09T06:47:06.4543612Z GIT_TERMINAL_PROMPT=0
2020-09-09T06:47:06.4543913Z GOROOT=/opt/hostedtoolcache/go/1.14.7/x64
2020-09-09T06:47:06.4544279Z GOROOT_1_14_X64=/opt/hostedtoolcache/go/1.14.7/x64
2020-09-09T06:47:06.4544642Z GOROOT_1_15_X64=/opt/hostedtoolcache/go/1.15.0/x64
2020-09-09T06:47:06.4544973Z GRADLE_HOME=/usr/share/gradle
2020-09-09T06:47:06.4545259Z HOME=/home/vsts
2020-09-09T06:47:06.4545566Z HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
2020-09-09T06:47:06.4545920Z HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
2020-09-09T06:47:06.4546402Z HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
2020-09-09T06:47:06.4546749Z INVOCATION_ID=fd4901547e8f418497626a2a9334c199
2020-09-09T06:47:06.4547031Z ImageOS=ubuntu20
2020-09-09T06:47:06.4547291Z ImageVersion=20200901.1
2020-09-09T06:47:06.4547863Z JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
2020-09-09T06:47:06.4548340Z JAVA_HOME_11_X64=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
2020-09-09T06:47:06.4548958Z JAVA_HOME_8_X64=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
2020-09-09T06:47:06.4549264Z JOURNAL_STREAM=9:33108
2020-09-09T06:47:06.4549599Z LANG=C.UTF-8
2020-09-09T06:47:06.4549830Z LEIN_HOME=/usr/local/lib/lein
2020-09-09T06:47:06.4550305Z LEIN_JAR=/usr/local/lib/lein/self-installs/leiningen-2.9.4-standalone.jar
2020-09-09T06:47:06.4553919Z M2_HOME=/usr/share/apache-maven-3.6.3
2020-09-09T06:47:06.4556149Z METADATA_50F3BE89-3465-42E2-9B61-437C6A3F294D={"name":"4cac5f3d-41c9-4561-a135-f623d5d0e044","resourceUris":[],"metadata":{"description":"","relatedUrls":[{"url":"https://dev.azure.com/FooBar/DevOps/_releaseProgress?releaseId=439","label":"pipeline-url"}],"humanReadableName":"Test Results from Publish Test Results utility","serializedPayload":"{\"testId\":\"PublishTestResults\",\"testTool\":\"JUnit\",\"testResultAttestation\":{\"total\":1,\"failed\":1,\"passed\":0,\"skipped\":0},\"testDurationSeconds\":0.0,\"testPassPercentage\":\"0\",\"relatedUrls\":[{\"url\":\"https://dev.azure.com/FooBar/DevOps/_releaseProgress?releaseId=439\",\"label\":\"pipeline-url\"}]}"}}
2020-09-09T06:47:06.4557746Z MOZ_HEADLESS=1
2020-09-09T06:47:06.4558235Z MSDEPLOY_HTTP_USER_AGENT=VSTS_cc238bb7-326d-4869-a7f3-96876f9e92d4_Release__439_1088_1
2020-09-09T06:47:06.4559038Z PATH=/opt/hostedtoolcache/Python/3.8.5/x64/bin:/opt/hostedtoolcache/Python/3.8.5/x64:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
2020-09-09T06:47:06.4559980Z POWERSHELL_DISTRIBUTION_CHANNEL=Azure-DevOps-ubuntu20
2020-09-09T06:47:06.4560216Z PWD=/home/vsts/work/r1/a
2020-09-09T06:47:06.4560488Z RELEASE_ARTIFACTS__ENV_IB_BUILDID=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-09T06:47:06.4560816Z RELEASE_ARTIFACTS__ENV_IB_BUILDNUMBER=245d8353
2020-09-09T06:47:06.4561360Z RELEASE_ARTIFACTS__ENV_IB_DEFINITIONID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4561717Z RELEASE_ARTIFACTS__ENV_IB_DEFINITIONNAME=git_repo
2020-09-09T06:47:06.4562260Z RELEASE_ARTIFACTS__ENV_IB_DEFINTIONID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4562957Z RELEASE_ARTIFACTS__ENV_IB_PROJECTID=26e0964e-87e4-4a88-acb5-c7bd32e139cf
2020-09-09T06:47:06.4563285Z RELEASE_ARTIFACTS__ENV_IB_PROJECTNAME=DevOps
2020-09-09T06:47:06.4563817Z RELEASE_ARTIFACTS__ENV_IB_REPOSITORY_ID=63103158-3a20-4e26-be94-1b3c3bd2351d
2020-09-09T06:47:06.4564172Z RELEASE_ARTIFACTS__ENV_IB_REPOSITORY_NAME=git_repo
2020-09-09T06:47:06.4564504Z RELEASE_ARTIFACTS__ENV_IB_REPOSITORY_PROVIDER=Git
2020-09-09T06:47:06.4564917Z RELEASE_ARTIFACTS__ENV_IB_REPOSITORY_URI=https://FooBar@dev.azure.com/FooBar/DevOps/_git/git_repo
2020-09-09T06:47:06.4565355Z RELEASE_ARTIFACTS__ENV_IB_SOURCEBRANCH=master
2020-09-09T06:47:06.4565733Z RELEASE_ARTIFACTS__ENV_IB_SOURCEVERSION=245d8353d0633fac2b914b1f8584354ac36ccb2f
2020-09-09T06:47:06.4566050Z RELEASE_ARTIFACTS__ENV_IB_TYPE=Git
2020-09-09T06:47:06.4566259Z RELEASE_ATTEMPTNUMBER=1
2020-09-09T06:47:06.4566463Z RELEASE_DEFINITIONENVIRONMENTID=49
2020-09-09T06:47:06.4566657Z RELEASE_DEFINITIONID=18
2020-09-09T06:47:06.4566870Z RELEASE_DEFINITIONNAME=UI Test Env/IB
2020-09-09T06:47:06.4567122Z RELEASE_DEPLOYMENTID=892
2020-09-09T06:47:06.4567331Z RELEASE_DEPLOYMENT_REQUESTEDFOR=John Doe
2020-09-09T06:47:06.4567696Z RELEASE_DEPLOYMENT_REQUESTEDFOREMAIL=john.doe@foobar.org
2020-09-09T06:47:06.4568133Z RELEASE_DEPLOYMENT_REQUESTEDFORID=1d8fdefb-8d8d-63f4-8dc8-13261769cb83
2020-09-09T06:47:06.4568543Z RELEASE_DEPLOYMENT_STARTTIME=2020-09-09 06:46:26Z
2020-09-09T06:47:06.4568759Z RELEASE_DEPLOYPHASEID=866
2020-09-09T06:47:06.4568919Z RELEASE_ENVIRONMENTID=1088
2020-09-09T06:47:06.4569108Z RELEASE_ENVIRONMENTNAME=Environment Dev
2020-09-09T06:47:06.4569379Z RELEASE_ENVIRONMENTS_ENV_DEV_STATUS=InProgress
2020-09-09T06:47:06.4569639Z RELEASE_ENVIRONMENTURI=vstfs:///ReleaseManagement/Environment/1088
2020-09-09T06:47:06.4569904Z RELEASE_PRIMARYARTIFACTSOURCEALIAS=_git_repo
2020-09-09T06:47:06.4570110Z RELEASE_REASON=Manual
2020-09-09T06:47:06.4570266Z RELEASE_RELEASEDESCRIPTION=
2020-09-09T06:47:06.4570420Z RELEASE_RELEASEID=439
2020-09-09T06:47:06.4570706Z RELEASE_RELEASENAME=Release-28
2020-09-09T06:47:06.4570939Z RELEASE_RELEASEURI=vstfs:///ReleaseManagement/Release/439
2020-09-09T06:47:06.4571508Z RELEASE_RELEASEWEBURL=https://dev.azure.com/FooBar/26e0964e-87e4-4a88-acb5-c7bd32e139cf/_release?releaseId=439&_a=release-summary
2020-09-09T06:47:06.4571880Z RELEASE_REQUESTEDFOR=John Doe
2020-09-09T06:47:06.4572092Z RELEASE_REQUESTEDFOREMAIL=john.doe@foobar.org
2020-09-09T06:47:06.4572479Z RELEASE_REQUESTEDFORID=1d8fdefb-8d8d-63f4-8dc8-13261769cb83
2020-09-09T06:47:06.4572698Z RELEASE_SKIPARTIFACTSDOWNLOAD=False
2020-09-09T06:47:06.4572884Z RELEASE_TRIGGERINGARTIFACT_ALIAS=
2020-09-09T06:47:06.4573241Z REQUESTEDFORID=1d8fdefb-8d8d-63f4-8dc8-13261769cb83
2020-09-09T06:47:06.4573459Z RUNNER_TOOLSDIRECTORY=/opt/hostedtoolcache
2020-09-09T06:47:06.4573837Z SELENIUM_JAR_PATH=/usr/share/java/selenium-server-standalone.jar
2020-09-09T06:47:06.4574028Z SHLVL=0
2020-09-09T06:47:06.4574188Z SWIFT_PATH=/usr/share/swift/usr/bin
2020-09-09T06:47:06.4574346Z SYSTEM=release
2020-09-09T06:47:06.4575111Z SYSTEM_ARTIFACTSDIRECTORY=/home/vsts/work/r1/a
2020-09-09T06:47:06.4575655Z SYSTEM_COLLECTIONID=cc238bb7-326d-4869-a7f3-96876f9e92d4
2020-09-09T06:47:06.4575933Z SYSTEM_COLLECTIONURI=https://vsrm.dev.azure.com/FooBar/
2020-09-09T06:47:06.4576251Z SYSTEM_CULTURE=en-US
2020-09-09T06:47:06.4576397Z SYSTEM_DEBUG=true
2020-09-09T06:47:06.4576576Z SYSTEM_DEFAULTWORKINGDIRECTORY=/home/vsts/work/r1/a
2020-09-09T06:47:06.4577477Z SYSTEM_DEFINITIONID=18
2020-09-09T06:47:06.4577663Z SYSTEM_DEFINITIONNAME=UI Test Env/IB
2020-09-09T06:47:06.4577864Z SYSTEM_ENABLEACCESSTOKEN=False
2020-09-09T06:47:06.4578025Z SYSTEM_HOSTTYPE=release
2020-09-09T06:47:06.4578185Z SYSTEM_JOBATTEMPT=1
2020-09-09T06:47:06.4578345Z SYSTEM_JOBDISPLAYNAME=Run on agent
2020-09-09T06:47:06.4578923Z SYSTEM_JOBID=de5c6dbd-26ae-5be8-ab4e-58b5ad2bab24
2020-09-09T06:47:06.4579226Z SYSTEM_JOBIDENTIFIER=Stage_26e0964e87e44a88acb5c7bd32e139cf_49_1.Phase_1.__default
2020-09-09T06:47:06.4579507Z SYSTEM_JOBNAME=__default
2020-09-09T06:47:06.4579696Z SYSTEM_JOBPARALLELISMTAG=Private
2020-09-09T06:47:06.4579890Z SYSTEM_JOBPOSITIONINPHASE=1
2020-09-09T06:47:06.4580064Z SYSTEM_JOBTIMEOUT=0
2020-09-09T06:47:06.4580248Z SYSTEM_PHASEATTEMPT=1
2020-09-09T06:47:06.4580438Z SYSTEM_PHASEDISPLAYNAME=Run on agent
2020-09-09T06:47:06.4580842Z SYSTEM_PHASEID=4503780d-2661-5c34-147b-6570aa10758d
2020-09-09T06:47:06.4581065Z SYSTEM_PHASENAME=Phase_1
2020-09-09T06:47:06.4581481Z SYSTEM_PIPELINESTARTTIME=2020-09-09 08:46:36+02:00
2020-09-09T06:47:06.4581926Z SYSTEM_PLANID=d7d9c78c-ea4c-4e68-8222-eb1661b75e54
2020-09-09T06:47:06.4582151Z SYSTEM_SERVERTYPE=Hosted
2020-09-09T06:47:06.4582325Z SYSTEM_STAGEATTEMPT=1
2020-09-09T06:47:06.4582533Z SYSTEM_STAGEDISPLAYNAME=Environment Dev
2020-09-09T06:47:06.4582936Z SYSTEM_STAGEID=a39027c1-7219-584e-a071-2c6cd538d664
2020-09-09T06:47:06.4583213Z SYSTEM_STAGENAME=Stage_26e0964e87e44a88acb5c7bd32e139cf_49_1
2020-09-09T06:47:06.4583526Z SYSTEM_TASKDEFINITIONSURI=https://dev.azure.com/FooBar/
2020-09-09T06:47:06.4583781Z SYSTEM_TASKDISPLAYNAME=Dump env
2020-09-09T06:47:06.4584190Z SYSTEM_TASKINSTANCEID=c08b59b9-7e77-5f93-b3a8-2ee69bf01352
2020-09-09T06:47:06.4584594Z SYSTEM_TASKINSTANCENAME=CmdLine5
2020-09-09T06:47:06.4585068Z SYSTEM_TEAMFOUNDATIONCOLLECTIONURI=https://dev.azure.com/FooBar/
2020-09-09T06:47:06.4585416Z SYSTEM_TEAMFOUNDATIONSERVERURI=https://vsrm.dev.azure.com/FooBar/
2020-09-09T06:47:06.4585764Z SYSTEM_TEAMPROJECT=DevOps
2020-09-09T06:47:06.4586177Z SYSTEM_TEAMPROJECTID=26e0964e-87e4-4a88-acb5-c7bd32e139cf
2020-09-09T06:47:06.4586737Z SYSTEM_TIMELINEID=d7d9c78c-ea4c-4e68-8222-eb1661b75e54
2020-09-09T06:47:06.4586968Z SYSTEM_TOTALJOBSINPHASE=1
2020-09-09T06:47:06.4587159Z SYSTEM_WORKFOLDER=/home/vsts/work
2020-09-09T06:47:06.4587351Z TASK_DISPLAYNAME=Dump env
2020-09-09T06:47:06.4587527Z TF_BUILD=True
2020-09-09T06:47:06.4587753Z USEPYTHONVERSION_PYTHONLOCATION=/opt/hostedtoolcache/Python/3.8.5/x64
2020-09-09T06:47:06.4587978Z USER=vsts
2020-09-09T06:47:06.4588165Z VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg
2020-09-09T06:47:06.4588409Z VSTS_AGENT_PERFLOG=/home/vsts/perflog
2020-09-09T06:47:06.4588846Z VSTS_PROCESS_LOOKUP_ID=vsts_b6a9f058-8420-4f45-88ce-250586a66a35
2020-09-09T06:47:06.4589171Z _=/usr/bin/env
2020-09-09T06:47:06.4589330Z agent.jobstatus=Failed
eric-labelle commented 4 years ago

Ok. I might have an idea to fix it. I could try to send you a temporary patched version (that would only work for release pipeline) of the extension if you know how to override an installed extension on DevOps using tfx. Otherwise I'll need to find time to reproduce your setup and try to fix it and then do a proper release to support both release and build pipeline. I really suspect it is related to the release pipeline but if you can confirm the task is working properly in a Build Pipeline it would help me.

JG127 commented 4 years ago

great ! :+1:

For what I am concerned, it depends if you have time to make a proper release. If that's the case, I'll wait no problem. Unless it would help you that I try a few things first.

confrontend commented 3 years ago

I am experiencing the same on a Release Pipeline. I would be also interested in your patch @eric-labelle

eric-labelle commented 3 years ago

Ok, thanks for confirming @Confrontend . I'm sorry I am really busy on other projects lately. I'll try to find some time to test this and fix it! In the meantime, the only workaround I can suggest is to use it in a build pipeline :-/

vasily-bogomazov commented 3 years ago

Hi Eric, Any updates on the release pipeline implementation? I don't quite have the same error, but the task skips for me every time, as if there are no failures in the report, but there are actually failures. The task is working fine in the build pipeline. Using the same Maven tasks for running the tests in both pipelines. Thanks!

reevelau commented 3 years ago

@eric-labelle Thank you very much for this extension. I wish to use this extension in Release Pipeline on Azure Devops as well. But the task will always be skipped. I enabled "system.debug=true" and got the following messages.

2021-07-19T01:02:08.8120602Z ##[debug]task result: Skipped
2021-07-19T01:02:08.8123880Z ##[debug]Processed: ##vso[task.complete result=Skipped;]No test failures found.
2021-07-19T01:02:08.8134592Z ##[section]Finishing: Publish screenshot

By reading the code, I suspected there might be an API changes in Azure side somehow splitting the "getTestResults" by either build or release in testapi. When we use this extension in release pipeline, the call of getTestResultsByBuild in line 29 will return empty result and skipping the rest of the logic.

So there is not possible for us to use this plugin to get test result that is published in Release Pipeline i.e. adding "Publish Test Results" one step below the Publish Test Results in Release Pipeline Task.

Edit

In an attempt to fix it as a private extension, I found that getTestResultsByRelease didn't return anything. So I end up calling getTestRuns given current buildUri to list all TestRun and filter the latest TestRun Id. It works in my setup, but it might have concurrent issue in general.

eric-labelle commented 3 years ago

Yes @reevelau Release pipelines are not yet supported, but there's actually a PR opened to add support for Release Pipelines. I'm waiting feedback from the author.

ashagraw91 commented 1 year ago

any update on release pipeline fix

NGarg29 commented 1 year ago

@eric-labelle The task for Publish Test Results Screenshot is working in build pipeline. But not in release. Can you please provide a fix or extension version to overcome this problem.

eric-labelle commented 1 year ago

@eric-labelle The task for Publish Test Results Screenshot is working in build pipeline. But not in release. Can you please provide a fix or extension version to overcome this problem.

Sorry @NGarg29 but I am not longer working at this company and don't have access to any Azure Devops instance anymore.

kjgen commented 2 months ago

Closing issue because the extension is being deprecated and will no longer be maintained. An alternative solution is to use the Publish Test Result task which now supports file attachments.