Skip to content
New issue

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

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

Already on GitHub? # to your account

Test projects are not running or failing #15231

Closed
rhyous opened this issue Aug 27, 2021 · 5 comments
Closed

Test projects are not running or failing #15231

rhyous opened this issue Aug 27, 2021 · 5 comments

Comments

@rhyous
Copy link

rhyous commented Aug 27, 2021

Question, Bug, or Feature?
Bug

Enter Task Name: VSTest@2

- task: VSTest@2
  condition: and(succeeded(), eq(variables['skipTests'], 'false'))
  displayName: 'Test Assemblies'
  inputs:
    testSelector: 'testAssemblies'
    testAssemblyVer2: |
      **\$(BuildConfiguration)\**\*test*.dll
      !**\obj\**
    searchFolder: '$(System.DefaultWorkingDirectory)'
    testFiltercriteria: 'TestCategory=Unit&TestCategory!=ToBeFixed&TestCategory!=DataDriven'
    runOnlyImpactedTests: false
    vsTestVersion: 'toolsInstaller'
    runInParallel: true
    codeCoverageEnabled: true
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'
    diagnosticsEnabled: false

Environment

Azure Pipelines

  • Agent - Hosted or Private:

Private

Issue Description

Projects are not unit tested because of a System.IO.FileNotFoundException error while trying to find the tests in a test project.

Worse, these errors don't fail the test task. I have multiple test projects that aren't even running their tests.

If tests for a project fail to run due to an error, the task should NOT be marked as successful.

Task logs

Example1:

No test matches the given testcase filter `TestCategory=Unit&TestCategory!=ToBeFixed&TestCategory!=DataDriven` in C:\BuildAgent\_work\1\s\src\Clients\Clients2.Common.Tests\bin\Debug\netcoreapp3.1\cs\Microsoft.TestPlatform.CrossPlatEngine.resources.dll
[MSTest][Discovery][C:\BuildAgent\_work\1\s\src\Clients\Clients2.Common.Tests\bin\Debug\netcoreapp3.1\Rhyous.WebFramework.Clients2.Common.Tests.dll] Unable to load types from the test source 'C:\BuildAgent\_work\1\s\src\Clients\Clients2.Common.Tests\bin\Debug\netcoreapp3.1\Rhyous.WebFramework.Clients2.Common.Tests.dll'. Some or all of the tests in this source may not be discovered.
Error: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

Example2:

No test matches the given testcase filter `TestCategory=Unit&TestCategory!=ToBeFixed&TestCategory!=DataDriven` in C:\BuildAgent\_work\1\s\src\WebServices\Webservices.Wcf.Tests\bin\Debug\net48\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
No test matches the given testcase filter `TestCategory=Unit&TestCategory!=ToBeFixed&TestCategory!=DataDriven` in C:\BuildAgent\_work\1\s\src\WebServices\Webservices.Wcf.Tests\bin\Debug\net48\Microsoft.TestPlatform.AdapterUtilities.dll
2.2271
[MSTest][Discovery][C:\BuildAgent\_work\1\s\src\WebServices\Webservices.Wcf.Tests\bin\Debug\net48\Ivanti.Tools.UnitTestFramework.dll] Unable to load types from the test source 'C:\BuildAgent\_work\1\s\src\WebServices\Webservices.Wcf.Tests\bin\Debug\net48\Ivanti.Tools.UnitTestFramework.dll'. Some or all of the tests in this source may not be discovered.
Error: System.IO.FileNotFoundException: Could not load file or assembly 'Autofac, Version=4.9.4.0, Culture=neutral, PublicKeyToken=17863af14b0044da' or one of its dependencies. The system cannot find the file specified.

Troubleshooting

n/a

Error logs

n/a

@github-actions
Copy link

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

@rhyous
Copy link
Author

rhyous commented Mar 2, 2022

It is still happening. Has anyone taken a look at this?

@rhyous
Copy link
Author

rhyous commented Mar 2, 2022

Why are we closing something without looking at it?
I can't find a way to re-open this.

@rhyous
Copy link
Author

rhyous commented Mar 3, 2022

Looks like I'm not the only one reporting this issue:
microsoft/vstest#1899
microsoft/testfx#499
microsoft/testfx#524 <-- Was it fixed in this one with a setting? If so, the setting should be on by default.

@riQQ
Copy link

riQQ commented Mar 9, 2023

See also #14328.

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

No branches or pull requests

4 participants