Open rohanwayachal opened 7 months ago
It appears that after running a multitarget build and test, the code coverage for .NET Framework 4.6.2 (net462) is not being published. Let's troubleshoot this issue.
Check Output Folder: Ensure that the output folder for your test results and code coverage reports is correctly specified. In your VSTest tasks, you're using $(System.DefaultWorkingDirectory)\out\$(BuildConfiguration)
as the search folder. Confirm that the test results and coverage files are indeed generated in this location.
Verify Test Assembly Path: In the VSTest tasks, you've specified the test assembly pattern for both .NET 6 and .NET Framework 4.6.2. Make sure that the wildcard pattern **\net462\Tests\Async.Bridges.*Tests.dll
matches the actual location of your test assemblies. Double-check the path and ensure that the test DLLs are present in the expected directory.
Code Coverage Settings: Ensure that your runSettingsFile
(located at src/Default.runsettings
) includes the necessary configuration for code coverage. Specifically, check if the <DataCollector>
section includes the CodeCoverage
data collector. If not, add it to the run settings file.
Permissions and Access: Verify that the build agent or self-hosted environment has the necessary permissions to read/write files in the specified output folder. Sometimes issues arise due to insufficient permissions.
Logging and Diagnostics: Enable detailed logging and diagnostics for the VSTest tasks. Set diagnosticsEnabled: true
to get more information about what's happening during the test execution. Review the logs for any relevant error messages or warnings related to code coverage.
Rerun Failed Tests: You've configured the tasks to rerun failed tests (rerunFailedTests: true
). If any tests fail during the initial run, they will be retried. Check if any tests are consistently failing and investigate why.
Thresholds and Minimum Expected Tests: You've set thresholds for rerunning failed tests (rerunFailedThreshold
) and specified a minimum expected test count (minimumExpectedTests
). Ensure that these values align with your expectations. If the minimum expected tests are not met, the build may fail.
Missing Value for rerunFailedThreshold
: It seems there's a missing value for rerunFailedThreshold
in your configuration. Please provide the appropriate value (e.g., 20
as shown in your .NET 6 task).
Task name
VSTest
Task version
2
Environment type (Please select at least one enviroment where you face this issue)
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
Question