File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 1- Get-ChildItem - Recurse - Filter " *Tests.csproj" - Path . | ForEach-Object {
2- $proj = $_.FullName
3- $projName = $_.Name
1+ function Run-TestProject ($proj ) {
2+ $projName = (Get-Item $proj ).Name
43 [xml ]$xml = Get-Content $proj
54
65 # Collect all framework values from TargetFrameworks and TargetFramework elements
@@ -23,3 +22,22 @@ Get-ChildItem -Recurse -Filter "*Tests.csproj" -Path . | ForEach-Object {
2322 if ($LASTEXITCODE -ne 0 ) { throw " Tests failed for $projName [$fw ]" }
2423 }
2524}
25+
26+ # Run ApiBuilderTests first
27+ $apiBuilderTests = Get-ChildItem - Recurse - Filter " ApiBuilderTests.csproj" - Path .
28+ if ($apiBuilderTests ) {
29+ Run- TestProject $apiBuilderTests.FullName
30+
31+ # Check for git diffs after ApiBuilderTests
32+ $gitDiff = git diff -- stat HEAD
33+ if ($gitDiff ) {
34+ Write-Host " Git diffs detected after ApiBuilderTests:" - ForegroundColor Red
35+ Write-Host $gitDiff
36+ throw " Build failed: Uncommitted changes detected after running ApiBuilderTests"
37+ }
38+ }
39+
40+ # Run remaining test projects
41+ Get-ChildItem - Recurse - Filter " *Tests.csproj" - Path . | Where-Object { $_.Name -ne " ApiBuilderTests.csproj" } | ForEach-Object {
42+ Run- TestProject $_.FullName
43+ }
You can’t perform that action at this time.
0 commit comments