I have some NUnit tests and have worked through the instructions to run Azure Test Plans. The test binaries build from a build script that links a test dll to the pipeline setup per the instructions. All appears to work with the following pipeline
Until step 4 of Run the automated tests which fails with errors:
No test sources found
and
[error]The slice of type 'Execution' is 'Aborted' because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.
The test logs say
Creating run for selected test assemblies with following parameters
SourceFilter: *.dll TestCaseFilter:
My test assembly is actually called MyProject.Test.dll
and it was built with these instructions
/p:PackageLocation="$(build.artifactstagingdirectory)\\Test\\"
In the previous step to running any test the artifacts are downloaded like this:
If I change the Test run
type to Test assemblies
in the Azure test script
I get an error from the Azure Test Plan run saying
However, it's possible to "release" the new test script, which appears to succeed like this
Though in reality there was a similar error, fixed later below:
[warning]No test assemblies found matching the pattern: **\bin\x64\Release\*Test*.dll.
The NUnit test run fine from Visual Studio, they build ok, but I can't trigger them to run from the Azure Devops, aaargh. There were 2 problems there:
- There was no build task to copy
dll
andconfig
libraries to the$(build.artifactstagingdirectory)\\Test\\
directory. I added a "copy files" task to the build script.
- Once that was done I could see in the "Download Artifacts" stage that test libraries were downloaded to the test directory
I set the release pipeline search folder to include the path to the downloaded artifacts
Now the Test Assemblies run via a "release"
How can I run this using the Test Run selection?
There is still error:
[error]The slice of type 'Execution' is 'Aborted' because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct