Skip to content

Move ImageBuilder tests to pre-build validation#2016

Open
lbussell wants to merge 1 commit intodotnet:mainfrom
lbussell:move-tests
Open

Move ImageBuilder tests to pre-build validation#2016
lbussell wants to merge 1 commit intodotnet:mainfrom
lbussell:move-tests

Conversation

@lbussell
Copy link
Member

@lbussell lbussell commented Mar 12, 2026

ImageBuilder only has unit tests -- it does not have any tests that inspect or run the ImageBuilder container image produced by the build pipeline. The test script simply runs dotnet test and does not do anything platform specific. Therefore, we are wasting pipeline time by running these tests in parallel on multiple build agents.

This PR moves ImageBuilder's tests from distributed Test jobs to the PreBuildValidation job, so that the tests run only once, and before spinning up extra build agents to build the ImageBuilder container images. The entire test stage will also be skipped, including Test matrix generation and spinning up build agents for 4 multiple platforms.

This reduces CPU/Machine time spent in the ImageBuilder build pipeline by 22%, from 1h31m to 1h11m (comparing build#2924511 and build#2925370 (This PR)). Wall clock time is difficult to compare directly due to build agent queue times, but the pipeline will now only use 11 separate jobs instead of 16 jobs, which means the pipeline will be less affected by build agent wait times.

Related:

ImageBuilder tests are pure dotnet test runs that don't need built container
images. Move them from the Test stage (multi-platform matrix) to
PreBuildValidation (single Linux AMD64 job in the Build stage) by swapping
testScriptPath and preBuildTestScriptPath. This skips the entire Test stage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lbussell lbussell requested a review from a team as a code owner March 12, 2026 23:59
Copy link
Member

@mthalman mthalman left a comment

Choose a reason for hiding this comment

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

By moving this to pre-build, there's no exercising of the Test stage in the docker-tools pipelines. Given that this repo is the definition of the pipeline infrastructure, it'd be good to continue to ensure that all the stages are working properly.

@lbussell
Copy link
Member Author

By moving this to pre-build, there's no exercising of the Test stage in the docker-tools pipelines. Given that this repo is the definition of the pipeline infrastructure, it'd be good to continue to ensure that all the stages are working properly.

We should exercise it in the eng-validation pipeline instead. Looks like that isn't happening currently. I will take a look at enabling that in this PR.

@lbussell
Copy link
Member Author

@mthalman it is running:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants