Skip to content

[BUG]: ##[error]Error occurred while publishing test results : System.Exception: No tests were discovered while attempting to rerun failed tests. This is likely to happen if these tests are xunit or nunit datadriven/parameterized tests or tests with custom display names with spaces or special characters which are not supported with rerun. Please reach out to us at https://github.com/microsoft/azure-pipelines-tasks/issues if you are hitting this for tests other than the ones mentioned before. #19534

Closed
@sowgampa

Description

New issue checklist

Task name

No response

Task version

No response

Issue Description

Reruns of failed tests is not happening in pipeline.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

Azure DevOps Server (Please specify exact version in the textbox below)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows

Relevant log output

unrecognized escape sequence.
2024-02-12T19:21:55.1675096Z ##[error]Stack trace:
2024-02-12T19:21:55.1675999Z ##[error]   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Discovery.DiscoveryContext.GetTestCaseFilter(IEnumerable`1 supportedProperties, Func`2 propertyProvider) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Discovery/DiscoveryContext.cs:line 44
2024-02-12T19:21:55.1676893Z ##[error]   at NUnit.VisualStudio.TestAdapter.VsTestFilter.get_TfsTestCaseFilterExpression() in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\VsTestFilter.cs:line 100
2024-02-12T19:21:55.1677671Z ##[error]   at NUnit.VisualStudio.TestAdapter.VsTestFilter.get_IsEmpty() in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\VsTestFilter.cs:line 102
2024-02-12T19:21:55.1678554Z ##[error]   at NUnit.VisualStudio.TestAdapter.NUnit3TestExecutor.InitializeForExecution(IRunContext runContext, IFrameworkHandle frameworkHandle) in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\NUnit3TestExecutor.cs:line 261
2024-02-12T19:21:55.1679511Z ##[error]   at NUnit.VisualStudio.TestAdapter.NUnit3TestExecutor.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in D:\repos\NUnit\nunit3-vs-adapter\src\NUnitTestAdapter\NUnit3TestExecutor.cs:line 108
2024-02-12T19:21:55.1684034Z ##[error]   at Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator.RunTests(IEnumerable`1 sources, IRunContext runContext, IFrameworkHandle frameworkHandle) in /_/src/Microsoft.TestPlatform.Common/ExtensionDecorators/SerialTestRunDecorator.cs:line 57
2024-02-12T19:21:55.1685141Z ##[error]   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.RunTestsWithSources.InvokeExecutor(LazyExtension`2 executor, Tuple`2 executorUriExtensionTuple, RunContext runContext, IFrameworkHandle frameworkHandle) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/RunTestsWithSources.cs:line 115
2024-02-12T19:21:55.1686238Z ##[error]   at Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.Execution.BaseRunTests.RunTestInternalWithExecutors(IEnumerable`1 executorUriExtensionMap, Int64 totalTests) in /_/src/Microsoft.TestPlatform.CrossPlatEngine/Execution/BaseRunTests.cs:line 466
2024-02-12T19:21:55.4439283Z Results File: C:\agent\_work\3\s\TestResults\aeqas_PEUS2-QALAB01_2024-02-12_19_21_55.trx
2024-02-12T19:21:55.4580766Z ##[error]Test Run Failed.
2024-02-12T19:21:55.4925693Z Vstest.console.exe exited with code 1.
2024-02-12T19:21:55.4926025Z **************** Completed test execution *********************
2024-02-12T19:21:55.4944550Z Test results files: C:\agent\_work\3\s\TestResults\aeqas_PEUS2-QALAB01_2024-02-12_19_21_55.trx
2024-02-12T19:21:55.4975088Z No Result Found to Publish 'C:\agent\_work\3\s\TestResults\aeqas_PEUS2-QALAB01_2024-02-12_19_21_55.trx'.
2024-02-12T19:21:55.4975524Z Updating test results: 0
2024-02-12T19:21:55.5623062Z Publishing test results to test run '5885'.
2024-02-12T19:21:55.6887904Z TestResults To Publish 0, Test run id:5885
2024-02-12T19:21:55.6888546Z Updated test results: 0
2024-02-12T19:21:55.6888675Z Publishing Attachments: 1
2024-02-12T19:21:55.8874187Z ##[error]Error occurred while publishing test results : System.Exception: No tests were discovered while attempting to rerun failed tests. This is likely to happen if these tests are xunit or nunit datadriven/parameterized tests or tests with custom display names with spaces or special characters which are not supported with rerun. Please reach out to us at https://github.com/microsoft/azure-pipelines-tasks/issues if you are hitting this for tests other than the ones mentioned before.
2024-02-12T19:21:56.0982365Z Execution Result Code 1 is non zero, checking for failed results
2024-02-12T19:21:56.2876685Z Completed TestExecution Model...
2024-02-12T19:21:56.2983346Z

Full task logs with system.debug enabled

2024-02-12T19:21:56.0982365Z Execution Result Code 1 is non zero, checking for failed results
2024-02-12T19:21:56.2876685Z Completed TestExecution Model...
2024-02-12T19:21:56.2983346Z

Repro steps

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'
    clean: true
    logFileVerbosity: normal

- task: VisualStudioTestPlatformInstaller@1
  inputs:
    packageFeedSelector: 'nugetOrg'
    versionSelector: 'latestStable'

- task: CopyFiles@2
  inputs:
    SourceFolder: '$(System.DefaultWorkingDirectory)\bin\Release\net6.0\'
    Contents: 'chromedriver.exe'
    TargetFolder: 'C:\Selenium\'

- task: VSTest@3
  inputs:
    testSelector: 'testAssemblies'
    testAssemblyVer2: |
      **\*AE_Automation*.dll
      !**\*TestAdapter.dll
      !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)'
    resultsFolder: '$(System.DefaultWorkingDirectory)\TestResults'
    testFiltercriteria: 'Category=AgentPortal'
    vsTestVersion: 'toolsInstaller'
    runInParallel: true
    testRunTitle: 'CurrentRun'
    rerunFailedTests: true
    rerunType: 'basedOnTestFailureCount'
    rerunFailedTestCasesMaxLimit: '10'
    rerunMaxAttempts: '2'
    continueOnError: true

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions