Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSTest@2 - Visual Studio 2022 not supported when explicit version is requested #16489

Closed
albertdev opened this issue Jun 24, 2022 · 5 comments
Closed

Comments

@albertdev
Copy link

Required Information

Question, Bug, or Feature?
Type: Bug

Task Name: VSTest@2

Issue Description

The testing task is started using the following YAML:

    - task: VSTest@2
      displayName: 'Run Unit Tests'
      inputs:
        testAssemblyVer2: |
         **\bin\$(BuildConfiguration)\*tests.dll
         !**\obj\**
        vsTestVersion: 17.0
        pathtoCustomTestAdapters: '$(Build.SourcesDirectory)\Source\packages'
        runInParallel: true
        runTestsInIsolation: true
        codeCoverageEnabled: false
        diagnosticsEnabled: True
        runSettingsFile: '$(Build.SourcesDirectory)\Source\UnitTest.runsettings'
      timeoutInMinutes: 15

The build server has Visual Studio 2022 installed and the VSBuild@2 task completes when vsVersion: 17.0 is passed. When the VSTest task starts then it will stop with the error "Given test platform version 17.0 is not supported."


It looks like people have been troubleshooting the root cause in the comments of issue 15522:

#15522 (comment)

Error logs

Starting: Run Unit Tests
==============================================================================
Task         : Visual Studio Test
Description  : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).
Version      : 2.205.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest
==============================================================================
SystemVssConnection exists true
SystemVssConnection exists true
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : null
Search folder : D:\BA2_work\1\s
Action when minimum tests threshold not met : donothing
Minimum tests expected to be run: 0
##[error]Error: Given test platform version 17.0 is not supported.
Finishing: Run Unit Tests
@albertdev albertdev changed the title VSTest@2 - Visual Studio 2022 not support when explicit version is requested VSTest@2 - Visual Studio 2022 not supported when explicit version is requested Jun 27, 2022
@mard
Copy link

mard commented Aug 30, 2022

I wanted to downgrade VSTest in my pipeline to 17.2 or at least 17.0, because 17.3 introduced some serious code coverage issues with my code - probably due to the Microsoft.CodeCoverage update that came with 17.3 release.

I worked around that by running the test suite in standalone VS Test Platform instead of stock Visual Studio present in the agent. I did that by changing vsTestVersion to 'toolsInstaller', but before that included a VS Test Platform Installer task with specific version.

- task: VisualStudioTestPlatformInstaller@1
  inputs:
    versionSelector: 'specificVersion'
    testPlatformVersion: '17.2.0'

- task: VSTest@2
  inputs:
    vsTestVersion: 'toolsInstaller'

Execution log may include a (false) warning that it doesn't include code coverage, but it's generated correctly. Read more here: #15449

@galakt
Copy link
Member

galakt commented Dec 10, 2022

Any updates?

@galakt
Copy link
Member

galakt commented Dec 10, 2022

@max-zaytsev Gentle ping. Also as far as I see '17.0` is not mentioned in the documentation

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@albertdev
Copy link
Author

For anyone visiting this issue: this might be resolved in #17858 based on the comments in a PR linked above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants