Hi Diptesh Kumar
The error "No test source files were specified" in your VSTest task likely means that the pipeline couldn't find any test assemblies to run.
Yes, validation is essential because it ensures that the test execution process is correctly set up and that the pipeline can locate and run the expected test assemblies.
As per your yaml file, please try the below steps:
- Ensure the correct path is provided for testAssemblyVer2 parameter. Example:
parameters:
test_assembly_paths: '**\bin\**\TestProject.dll'
- After the build step, check if test assemblies exist in the expected location (bin\Debug or bin\Release). You can add a step before VSTest to list the files:
- script: dir /s /b $(Build.SourcesDirectory)
displayName: 'List all files before test execution'
- The VSBuild step must compile unit test projects along with the main solution. If not, the test assemblies won’t exist. Modify the VSBuild task to include TestProject.sln explicitly:
solution: 'TestProject.sln'
- Set explicitly for testSelector Value
parameters:
test_selector: 'testAssemblies'
- To Validate VSTest Task Execution, add detailed logging for VSTest execution by enabling verbose output:
- task: VSTest@2
inputs:
testAssemblyVer2: '**\bin\**\TestProject.dll'
testFilterCriteria: ''
diagnosticsEnabled: true
displayName: 'Run Tests with Detailed Logs'
Hope this helps!
Please Let me know if you have any queries.