Skip to content

Allow repos to opt-out of building tests#46394

Merged
NikolaMilosavljevic merged 4 commits into
dotnet:mainfrom
NikolaMilosavljevic:test.optout
Jan 30, 2025
Merged

Allow repos to opt-out of building tests#46394
NikolaMilosavljevic merged 4 commits into
dotnet:mainfrom
NikolaMilosavljevic:test.optout

Conversation

@NikolaMilosavljevic

Copy link
Copy Markdown
Contributor

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
@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Jan 29, 2025
@akoeplinger

Copy link
Copy Markdown
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.

<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
Copy Markdown
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.

@ViktorHofer ViktorHofer Jan 29, 2025

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor 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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed with 51744b8


<PropertyGroup>
<DeterministicBuildOptOut>true</DeterministicBuildOptOut>
<DoNotBuildTests>true</DoNotBuildTests>

Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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.

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