-
Notifications
You must be signed in to change notification settings - Fork 644
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
Move test projects to SDK-based .csproj #10087
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jimmylewis
previously approved these changes
Jul 29, 2024
tests/NuGet.Services.DatabaseMigration.Facts/NuGet.Services.DatabaseMigration.Facts.csproj
Outdated
Show resolved
Hide resolved
tests/NuGet.Services.Entities.Tests/NuGet.Services.Entities.Tests.csproj
Outdated
Show resolved
Hide resolved
Leave it in functional test projects that don't use Xunit
jimmylewis
approved these changes
Jul 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will make transitive project references work much better. This would help with a repository merge since a package reference switching to a project reference will then still retain transitive dependency information. In legacy .csproj, project references are not transitive so without this change we would need to lift a lot of project dependencies into consuming projects when, say, NuGetGallery.Core switches from package reference to project reference.
This work also has the effect of modernizing our code base a bit. It theoretically makes a .NET Core move easier too.
This was done using the latest version of the .NET upgrade-assistant CLI tool with the following options:
upgrade-assistant upgrade {csproj path} --operation sdkstyle --non-interactive
.Unit tests will be run using
dotnet test
instead ofxunit.console.runner
. This is a modernization step. Functional tests still use xunit and vstest due to compatibility with old web test framework we use.This does most of the hard work. After this, I did manual clean-up steps:
SdkProjects.props
import<IsTestProject>true</IsTestProject>
to functional test .csproj. Xunit test projects have this automatically.AssemblyInfo.cs
unless there was Xunit parallelization attributes or custom metadataApp.config
in most cases (only leave minimal necessary things like EF directives)BuildTests.ps1
toBuildGalleryFunctionalTests.ps1
to ease repository merge with NuGet.JobsPublishTestResults
CI step to the latest version and change format toVSTest
(dotnet test) so test results are found