Skip to content

Allow repos to opt-out of building tests #46394

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

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

NikolaMilosavljevic
Copy link
Member

This is a prerequisite for us enabling tests in VMR, i.e. #44843

This PR sets the new opt-out property for repos that are not ready to build tests, for some reason. I will create issues for each of those repos with detailed info about test failures and steps forward. PRs with fixes would follow soon after.

This PR also fixes the issue with building tests in sdk repo.

I understand that the new property DoNotBuildTests has a very similar name to the property we use to enable tests: DotNetBuildTests. If there is a significant risk of confusion, we can change the name to something else.

@NikolaMilosavljevic NikolaMilosavljevic requested review from a team as code owners January 29, 2025 15:46
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Jan 29, 2025
@akoeplinger
Copy link
Member

I understand that the new property DoNotBuildTests has a very similar name to the property we use to enable tests: DotNetBuildTests. If there is a significant risk of confusion, we can change the name to something else.

Yes please, I already had to read that sentence twice to spot the difference :D

I'd call it DotNetBuildTestsOptOut to match the existing DeterministicBuildOptOut.

@@ -459,6 +459,9 @@
ProcessFrameworkReferences not be able to restore for the given RID. -->
<BuildArgs Condition="'$(DotNetBuildSourceOnly)' != 'true' and '@(TransitiveRepositoryReference->AnyHaveMetadataValue('Identity', 'runtime'))' == 'true'">$(BuildArgs) /p:DotNetBuildTargetRidOnly=true</BuildArgs>

<!-- Only pass when enabled to reduce command line noise. -->
<BuildArgs Condition="'$(DotNetBuildTests)' == 'true' and '$(DoNotBuildTests)' != 'true'">$(BuildArgs) /p:DotNetBuildTests=true</BuildArgs>
Copy link
Member

Choose a reason for hiding this comment

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

I do think the names are deceptively similar. I propose a name like ExcludeFromBuildingTests.

Copy link
Member

@ViktorHofer ViktorHofer Jan 29, 2025

Choose a reason for hiding this comment

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

This doesn't need to be in a target. Only properties that need dynamic resolution (like the one above) needs to be here.

I would put this here:

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's better - thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with 51744b8

@@ -2,6 +2,7 @@

<PropertyGroup>
<DeterministicBuildOptOut>true</DeterministicBuildOptOut>
<DoNotBuildTests>true</DoNotBuildTests>
Copy link
Member

Choose a reason for hiding this comment

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

Should we file tracking issues for these exclusions and add comments here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. I'll do that - thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed with 51744b8

@NikolaMilosavljevic
Copy link
Member Author

I understand that the new property DoNotBuildTests has a very similar name to the property we use to enable tests: DotNetBuildTests. If there is a significant risk of confusion, we can change the name to something else.

Yes please, I already had to read that sentence twice to spot the difference :D

I'd call it DotNetBuildTestsOptOut to match the existing DeterministicBuildOptOut.

Hmm, we have two naming proposals now: DotNetBuildTestsOptOut and ExcludeFromBuildingTests.

To me, ExcludeFromBuildingTests sounds better. However, we already have several OptOut-named properties, i.e. LogVerbosityOptOut and DeterministicBuildOptOut

@NikolaMilosavljevic
Copy link
Member Author

I understand that the new property DoNotBuildTests has a very similar name to the property we use to enable tests: DotNetBuildTests. If there is a significant risk of confusion, we can change the name to something else.

Yes please, I already had to read that sentence twice to spot the difference :D
I'd call it DotNetBuildTestsOptOut to match the existing DeterministicBuildOptOut.

Hmm, we have two naming proposals now: DotNetBuildTestsOptOut and ExcludeFromBuildingTests.

To me, ExcludeFromBuildingTests sounds better. However, we already have several OptOut-named properties, i.e. LogVerbosityOptOut and DeterministicBuildOptOut

OK - going with DotNetBuildTestsOptOut - will update the PR soon.

@NikolaMilosavljevic
Copy link
Member Author

I understand that the new property DoNotBuildTests has a very similar name to the property we use to enable tests: DotNetBuildTests. If there is a significant risk of confusion, we can change the name to something else.

Yes please, I already had to read that sentence twice to spot the difference :D

I'd call it DotNetBuildTestsOptOut to match the existing DeterministicBuildOptOut.

Fixed with 51744b8

@NikolaMilosavljevic
Copy link
Member Author

All checks are passing except an unrelated TestBuild: macOS (arm64) which is getting cancelled after 150 minutes. This is happening in other PRs as well.

@NikolaMilosavljevic NikolaMilosavljevic merged commit 0bc10be into dotnet:main Jan 30, 2025
35 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Infrastructure untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants