Skip to content

Commit afb28cf

Browse files
CopilotT-Gro
andcommitted
Support built-in dotnet commands in regression test template
Modified regression-test-jobs.yml to: - Skip file validation for commands starting with "dotnet" - Execute dotnet commands directly using Invoke-Expression - Maintain existing file-based script support - Handle both Windows and Linux scenarios appropriately This allows tests like UMX_Slow_Repro to use "dotnet build" directly without requiring a build script file. Co-authored-by: T-Gro <[email protected]>
1 parent a66248e commit afb28cf

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

eng/templates/regression-test-jobs.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,21 @@ jobs:
6060
Write-Host "Repository structure:"
6161
Get-ChildItem -Name
6262
63-
Write-Host "Verifying build script exists: ${{ item.buildScript }}"
64-
if (Test-Path "${{ item.buildScript }}") {
65-
Write-Host "Build script found: ${{ item.buildScript }}"
63+
# Check if buildScript is a built-in dotnet command or a file-based script
64+
$buildScript = "${{ item.buildScript }}"
65+
if ($buildScript -like "dotnet*") {
66+
Write-Host "Build command is a built-in dotnet command: $buildScript"
67+
Write-Host "Skipping file existence check for built-in command"
6668
} else {
67-
Write-Host "Build script not found: ${{ item.buildScript }}"
68-
Write-Host "Available files in root:"
69-
Get-ChildItem
70-
exit 1
69+
Write-Host "Verifying build script exists: $buildScript"
70+
if (Test-Path $buildScript) {
71+
Write-Host "Build script found: $buildScript"
72+
} else {
73+
Write-Host "Build script not found: $buildScript"
74+
Write-Host "Available files in root:"
75+
Get-ChildItem
76+
exit 1
77+
}
7178
}
7279
displayName: Checkout ${{ item.displayName }} at specific commit
7380
@@ -144,15 +151,20 @@ jobs:
144151
Write-Host "============================================"
145152
Write-Host ""
146153
147-
# Use dotnet pack with binary logging on Windows to generate binlog files
148-
# On Linux, execute the build script directly
149-
if ($IsWindows) {
154+
$buildScript = "${{ item.buildScript }}"
155+
156+
# Check if it's a built-in dotnet command or a file-based script
157+
if ($buildScript -like "dotnet*") {
158+
Write-Host "Executing built-in command: $buildScript"
159+
Invoke-Expression $buildScript
160+
} elseif ($IsWindows) {
161+
# Use dotnet pack with binary logging on Windows to generate binlog files
150162
Write-Host "Running: dotnet pack build.proj -bl:build.binlog"
151163
dotnet pack build.proj -bl:build.binlog
152164
} else {
153-
Write-Host "Executing: ${{ item.buildScript }}"
154-
chmod +x "${{ item.buildScript }}"
155-
bash -c "./${{ item.buildScript }}"
165+
Write-Host "Executing file-based script: $buildScript"
166+
chmod +x "$buildScript"
167+
bash -c "./$buildScript"
156168
}
157169
$exitCode = $LASTEXITCODE
158170

0 commit comments

Comments
 (0)