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

fix: multiple .net versions issue fixed #169

Merged
merged 4 commits into from
Jul 29, 2024
Merged

fix: multiple .net versions issue fixed #169

merged 4 commits into from
Jul 29, 2024

Conversation

IgorMikhalev
Copy link
Contributor

@IgorMikhalev IgorMikhalev commented Jul 29, 2024

Context

Description

The original issue was related to handling many projects with different .NET versions. The dotnet command searches for test DLLs in subfolders defined in a test project. However, if the test is run for a solution with the --no-build flag, the search subfolder might be incorrect. This leads to an error even for a DLLs with all tests passed (net8 subfolder is wrong):

The test source file "c:\Projects\Local\dotnet-test-rerun\test\dotnet-test-rerun.IntegrationTests\Fixtures\XUnitTwoMultipleProjectsWithDifferentNetVersion\XUnitNet48\bin\Debug\net8\XUnitSimpleTestExample.dll" was not found.

This results in an exit code 1, even if after a rerun all tests were run successfully.

The fix involves removing the addition of the framework version to the filter in the case of a test rerun. However, this fix has a slight disadvantage. If the same test supports multiple .NET versions, with the fix, all versions of the test will run. The differences are visible in the DotnetTestRerun_FailingXUnit_WithMultipleFrameworks_Fails test. This is a drawback, but I still find the result better. Running all configurations of a failing test instead of just one may not be necessary, but not fixing the issue makes the tool unusable in the above-defined case.

Changes in the codebase

No

Associated Issues

#165

@IgorMikhalev
Copy link
Contributor Author

This test works locally, I will try to fix this and recreate the PR afterwards.

@IgorMikhalev IgorMikhalev reopened this Jul 29, 2024
@ricardofslp ricardofslp changed the base branch from main to rpereira/issue-165-exit-code-1-after-successful-rerun July 29, 2024 18:12
@ricardofslp ricardofslp changed the base branch from rpereira/issue-165-exit-code-1-after-successful-rerun to main July 29, 2024 18:15
@ricardofslp
Copy link
Collaborator

Thanks @IgorMikhalev

@ricardofslp ricardofslp merged commit 7916185 into joaoopereira:main Jul 29, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exit code "1" after sucessfull rerun
2 participants