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 detecting test projects #930

Closed

Conversation

nohwnd
Copy link

@nohwnd nohwnd commented Mar 28, 2024

IsTestProject is used by dotnet test VSTest target to detect if a project is or is not a test project. Ensure that we don't mark shared test projects as test projects to avoid running them in a test run because they hold only shared utils, but not any tests.

Fix dotnet/sdk#39814
Fix #929

@@ -2,9 +2,9 @@
<!-- Folder layout -->
<PropertyGroup>
<IsBenchmarkProject Condition="$(MSBuildProjectName.ToLower().Contains('.benchmarks.'))">true</IsBenchmarkProject>
<IsTestProject Condition="$(MSBuildProjectName.ToLower().Contains('.tests.'))">true</IsTestProject>
<IsTestAssetProject Condition="$(MSBuildProjectName.ToLower().Contains('tests.shared.'))">true</IsTestAssetProject>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to prefix all your properties in Directory.Build.props by _. They seem to be used only here.

@robertmclaws
Copy link
Collaborator

Thanks for this! We've handled it a slightly different way and it seems to be working. Appreciate you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants