Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions eng/docker-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All breaking changes and new features in `eng/docker-tools` will be documented i

---

## 2026-03-04: Pre-build validation gated by `preBuildTestScriptPath` variable

The `PreBuildValidation` job condition now checks the new `preBuildTestScriptPath` variable instead of `testScriptPath`.
This allows repos to independently control whether pre-build validation runs, without affecting functional tests.

The new variable defaults to `$(testScriptPath)`, so existing repos that have pre-build tests are not affected.
Repos that do not have pre-build tests can set `preBuildTestScriptPath` to `""` to skip the job entirely.

---

## 2026-02-19: Separate Registry Endpoints from Authentication

- Pull request: [#1945](https://github.com/dotnet/docker-tools/pull/1945)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix: $[ ${{ parameters.matrix }} ]
${{ if eq(parameters.preBuildValidation, 'true') }}:
condition: and(succeeded(), ne(variables.testScriptPath, ''))
condition: and(succeeded(), ne(variables.preBuildTestScriptPath, ''))
pool: ${{ parameters.pool }}
timeoutInMinutes: ${{ parameters.testJobTimeout }}
steps:
Expand Down
1 change: 1 addition & 0 deletions eng/docker-tools/templates/variables/common-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ variables:
engDockerToolsPath: $(Build.Repository.LocalPath)/$(engDockerToolsRelativePath)
engPath: $(Build.Repository.LocalPath)/eng
testScriptPath: ""
preBuildTestScriptPath: $(testScriptPath)
2 changes: 2 additions & 0 deletions eng/pipelines/templates/variables/image-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ variables:
value: ./src/run-tests.ps1
- name: testResultsDirectory
value: src/ImageBuilder.Tests/TestResults/
- name: preBuildTestScriptPath
value: ""
29 changes: 11 additions & 18 deletions src/run-tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ param(
[switch]$DisableHttpVerification,
[switch]$PullImages,
[string]$ImageInfoPath,
[ValidateSet("functional", "pre-build")]
[string[]]$TestCategories = @("functional")
[string[]]$TestCategories = @()
)

Set-StrictMode -Version Latest
Expand All @@ -26,23 +25,17 @@ $dotnetInstallDir = "$PSScriptRoot/../.dotnet"

Push-Location $PSScriptRoot

if ($TestCategories.Contains("pre-build")) {
Write-Output "There are no pre-build tests"
}

if ($TestCategories.Contains("functional")) {
try {
& ../eng/docker-tools/Install-DotNetSdk.ps1 $dotnetInstallDir
try {
& ../eng/docker-tools/Install-DotNetSdk.ps1 $dotnetInstallDir

$cmd = "$DotnetInstallDir/dotnet test $PSScriptRoot/ImageBuilder.Tests/Microsoft.DotNet.ImageBuilder.Tests.csproj --logger:trx"
$cmd = "$DotnetInstallDir/dotnet test $PSScriptRoot/ImageBuilder.Tests/Microsoft.DotNet.ImageBuilder.Tests.csproj --logger:trx"

Write-Output "Executing '$cmd'"
Invoke-Expression $cmd
if ($LASTEXITCODE -ne 0) {
throw "Failed: '$cmd'"
}
}
finally {
Pop-Location
Write-Output "Executing '$cmd'"
Invoke-Expression $cmd
if ($LASTEXITCODE -ne 0) {
throw "Failed: '$cmd'"
}
}
finally {
Pop-Location
}
Loading