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

[REDO] Fix tests running on version freeze #10781

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Oct 9, 2024

This change had to be reverted because it caused issues on the pipeline due to attempt to access the locked dlls.
It occurred to me that bootstrap targets attempt to access the same set of dlls, so preparing test assets AFTER having the bootstrapped version must help.

Fixes #10702

Context

The issue stemmed from a missing Microsoft.Build package during the test execution. CustomCheck is compiled using a specific version of Microsoft.Build, but during the CheckCandidate run, this package couldn't be restored. This mismatch led to the problem.
Build FAILED. "/Users/runner/work/1/s/artifacts/bin/Microsoft.Build.BuildCheck.UnitTests/Debug/net9.0/TestAssets/CheckCandidate/CheckCandidate.csproj" (Restore target) (1) -> (Restore target) -> /Users/runner/work/1/s/artifacts/bin/Microsoft.Build.BuildCheck.UnitTests/Debug/net9.0/TestAssets/CheckCandidate/CheckCandidate.csproj : warning NU1701: Package 'Microsoft.IO.Redist 6.0.1' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project. "/Users/runner/work/1/s/artifacts/bin/Microsoft.Build.BuildCheck.UnitTests/Debug/net9.0/TestAssets/CheckCandidate/CheckCandidate.csproj" (Restore target) (1) -> (Restore target) -> /Users/runner/work/1/s/artifacts/bin/Microsoft.Build.BuildCheck.UnitTests/Debug/net9.0/TestAssets/CheckCandidate/CheckCandidate.csproj : error NU1102: Unable to find package Microsoft.Build with version (>= 17.12.0)

Solution

Pack Microsoft.Build and it's dependencies for the tests to a specific location.

@YuliiaKovalova YuliiaKovalova changed the title Fix tests running on version freeze [DON't Touch] Fix tests running on version freeze Oct 9, 2024
@YuliiaKovalova YuliiaKovalova force-pushed the revert-10775-revert-10735-dev/ykovalova/fix_custom_checks_tests branch from c431f0b to 507cd1a Compare October 22, 2024 14:25
@YuliiaKovalova YuliiaKovalova changed the title [DON't Touch] Fix tests running on version freeze [REDO] Fix tests running on version freeze Oct 23, 2024
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review October 23, 2024 12:03
@YuliiaKovalova YuliiaKovalova requested a review from a team as a code owner October 23, 2024 12:03
@YuliiaKovalova YuliiaKovalova merged commit bec60dc into main Oct 23, 2024
10 checks passed
@YuliiaKovalova YuliiaKovalova deleted the revert-10775-revert-10735-dev/ykovalova/fix_custom_checks_tests branch October 23, 2024 12:52
YuliiaKovalova added a commit that referenced this pull request Oct 24, 2024
rainersigwald pushed a commit that referenced this pull request Oct 24, 2024
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.

Reenable CustomCheck tests
3 participants