-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Only run template tests when templates change #62481
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
Conversation
@@ -582,10 +582,10 @@ stages: | |||
/p:VsTestUseMSBuildOutput=false | |||
displayName: Build shared fx | |||
# -noBuildRepoTasks -noBuildNative -noBuild to avoid repeating work done in the previous step. | |||
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -nobl -all -noBuildRepoTasks -noBuildNative -noBuild -test | |||
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -all -noBuildRepoTasks -noBuildNative -noBuild -test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a targeted Helix job that only runs template tests when files under src/ProjectTemplates
change, and updates existing CI pipelines to skip those tests by default.
- Introduces
OnlyTestProjectTemplates
MSBuild property and uses it to filter which projects are built/tested. - Adds a new Azure pipeline (
template-tests-pr.yml
) triggered on template folder changes. - Updates
ci.yml
andci-public.yml
to disable template tests by settingRunTemplateTests=false
.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
eng/helix/helix.proj | Added OnlyTestProjectTemplates condition to include only template test projects. |
eng/Build.props | Wrapped import of RequiresDelayedBuildProjects.props in the new property condition. |
.azure/pipelines/template-tests-pr.yml | New pipeline definition to run template tests on PRs touching ProjectTemplates . |
.azure/pipelines/ci.yml | Updated Helix build invocation to skip template tests by default. |
.azure/pipelines/ci-public.yml | Updated public CI invocation similarly to skip template tests. |
Comments suppressed due to low confidence (4)
.azure/pipelines/ci.yml:637
- The
-nobl
flag was removed here, which changes the build invocation from the original. You should include-nobl
to preserve the intended behavior.
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -all -noBuildRepoTasks -noBuildNative -noBuild -test
.azure/pipelines/ci-public.yml:585
- The
-nobl
flag was removed here as well, unintentionally altering the build behavior. Please restore-nobl
to match the original invocation.
- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -all -noBuildRepoTasks -noBuildNative -noBuild -test
.azure/pipelines/ci.yml:639
- You’re setting
RunTemplateTests=false
but the code usesOnlyTestProjectTemplates
to gate template test execution. Rename or duplicate this property so the MSBuild condition works correctly.
/p:CrossgenOutput=false /p:RunTemplateTests=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
.azure/pipelines/ci-public.yml:588
- This also uses
RunTemplateTests
, which doesn’t match theOnlyTestProjectTemplates
property in your MSBuild scripts. Use the same property name to ensure the skip logic actually takes effect.
/p:VsTestUseMSBuildOutput=false /p:RunTemplateTests=false
Helix took 1h 9m here, down from an average of about 2h |
Should significantly cut down on the time it takes to run Helix jobs (@BrennanConroy reports almost an hour of time save). Also adds a new job that will only run when the ProjectTemplates folder is touched, which runs just the template tests in Helix.
Note - some template tests run only in the local jobs. Those will still run in all PRs (but those ones are very quick)