Skip to content

Commit 31b866b

Browse files
committed
fixup! Run only quarantined tests in outer loop
1 parent 76552e0 commit 31b866b

File tree

18 files changed

+88
-54
lines changed

18 files changed

+88
-54
lines changed

.github/workflows/tests-outerloop.yml

+88-4
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ jobs:
4545

4646
- name: Run quarantined tests
4747
run: |
48-
${{ env.BUILD_SCRIPT }} -projects ${{ github.workspace }}/tests/Shared/SolutionTests.proj -restore -build -test -c Release /p:IsGitHubActions=true /p:RunQuarantinedTests=true /bl:${{ github.workspace }}/artifacts/log/Release/test-quarantined.binlog
48+
${{ env.BUILD_SCRIPT }} -projects ${{ github.workspace }}/tests/Shared/SolutionTests.proj -restore -build -test -c Release /p:IsGitHubActions=true /p:RunQuarantinedTests=true /bl:${{ github.workspace }}/artifacts/log/Release/test-quarantined.binlog
4949
5050
- name: Keep only relevant test logs
51+
if: always()
5152
shell: pwsh
5253
run: |
5354
# Define the directory to search for log files
5455
$logDirectory = "${{ github.workspace }}/artifacts/log/**/TestLogs"
5556
5657
# Define the text to search for in the log files
5758
$searchText = "No test matches the given testcase filter"
59+
$resultsFilePattern = "Results File: (.+)"
5860
5961
# Get all .log files in the specified directory and its subdirectories
6062
$logFiles = Get-ChildItem -Path $logDirectory -Filter *.log -Recurse
@@ -69,14 +71,96 @@ jobs:
6971
Remove-Item -Path $logFile.FullName -Force
7072
Write-Host "Removed file: $($logFile.FullName)"
7173
}
74+
else {
75+
# Extract paths from lines containing "Results File: <path>"
76+
foreach ($line in $content) {
77+
if ($line -match $resultsFilePattern) {
78+
$resultsFilePath = $matches[1]
79+
Write-Host "Found results file: $resultsFilePath"
80+
81+
# Copy the results file to the TestLogs folder
82+
$destinationPath = (Split-Path -Path $logFile.FullName -Parent)
83+
Copy-Item -Path $resultsFilePath -Destination $destinationPath -Force
84+
Write-Host "Copied $resultsFilePath to $destinationPath"
85+
}
86+
}
87+
}
88+
}
89+
90+
- name: Process logs and post results
91+
if: always()
92+
shell: pwsh
93+
run: |
94+
$logDirectory = "${{ github.workspace }}/artifacts/log/**/TestLogs"
95+
$trxFiles = Get-ChildItem -Path $logDirectory -Filter *.trx -Recurse
96+
97+
$testResults = @() # Initialize an array to store test results
98+
99+
foreach ($trxFile in $trxFiles) {
100+
# Load the .trx file as XML
101+
$xmlContent = [xml](Get-Content -Path $trxFile.FullName)
102+
103+
# Extract test results from the XML
104+
foreach ($testResult in $xmlContent.TestRun.Results.UnitTestResult) {
105+
$testName = $testResult.testName
106+
$outcome = $testResult.outcome
107+
$duration = $testResult.duration
108+
109+
# Map outcome to emoji
110+
switch ($outcome) {
111+
"Passed" { $emoji = "✔️" }
112+
"Failed" { $emoji = "❌" }
113+
default { $emoji = "❔" }
114+
}
115+
116+
# Normalize the duration to a consistent format (hh:mm:ss.fff)
117+
$normalizedDuration = [TimeSpan]::Parse($duration).ToString("mm\:ss\.fff")
118+
119+
# Add the test result to the array
120+
$testResults += [PSCustomObject]@{
121+
TestName = $testName
122+
Outcome = $outcome
123+
OutcomeIcon = $emoji
124+
Duration = $normalizedDuration
125+
}
126+
}
72127
}
73128
129+
# Sort the test results by test name
130+
$testResults = $testResults | Sort-Object -Property TestName
131+
132+
# Calculate summary statistics
133+
$totalTests = $testResults.Count
134+
$passedTests = ($testResults | Where-Object { $_.Outcome -eq "Passed" }).Count
135+
$failedTests = ($testResults | Where-Object { $_.Outcome -eq "Failed" }).Count
136+
$skippedTests = ($testResults | Where-Object { $_.Outcome -eq "NotExecuted" }).Count
137+
138+
# Add the summary to the annotation
139+
$summary = "total: $totalTests, passed: $passedTests, failed: $failedTests, skipped: $skippedTests"
140+
if ($failedTests -gt 0) {
141+
Write-Host "::error::Tests Summary: $summary"
142+
} else {
143+
Write-Host "::notice::Tests Summary: $summary"
144+
}
145+
146+
# Format the test results as a console-friendly table
147+
$tableHeader = "{0,-16} {1,-150} {2,-20}" -f "Duration", "Test Name", "Result"
148+
$tableSeparator = "-" * 185
149+
$tableRows = $testResults | ForEach-Object { "{0,-16} {1,-150} {2,-20}" -f $_.Duration, $_.TestName, "$($_.OutcomeIcon) $($_.Outcome)" }
150+
$table = "$tableHeader`n$tableSeparator`n" + ($tableRows -join "`n") + "`n$tableSeparator`n"
151+
Write-Host "`nTest Results:`n`n$table"
152+
153+
# Optionally, save the results to a file for further processing
154+
$outputPath = "${{ github.workspace }}/artifacts/log/Release/TestLogs/summary.log"
155+
$table | Out-File -FilePath $outputPath -Encoding utf8
156+
Write-Host "Test results saved to $outputPath"
157+
74158
- name: Upload logs, and test results
75159
if: always()
76160
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
77161
with:
78162
name: logs-${{ matrix.os.name }}
79163
path: |
80-
${{ github.workspace }}/artifacts/log/**/*.binlog
81-
${{ github.workspace }}/artifacts/log/**/TestLogs/**
82-
${{ github.workspace }}/TestResults/**
164+
${{ github.workspace }}/artifacts/log/*/*.binlog
165+
${{ github.workspace }}/artifacts/log/*/TestLogs/**
166+
retention-days: 5

eng/build.ps1

-2
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,3 @@ if ($env:TreatWarningsAsErrors -eq 'false') {
106106

107107
Write-Host "& `"$PSScriptRoot/common/build.ps1`" $arguments"
108108
Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $arguments"
109-
110-
exit 0

tests/Aspire.Cli.Tests/Hosting/CliOrphanDetectorTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public async Task CliOrphanDetectorAfterTheProcessWasRunningForAWhileThenStops()
9494
}
9595

9696
[Fact]
97-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7920", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnGithubActions), nameof(PlatformDetection.IsWindows))]
9897
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7920")]
9998
public async Task AppHostExitsWhenCliProcessPidDies()
10099
{

tests/Aspire.Dashboard.Tests/Integration/Playwright/AppBarTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public AppBarTests(DashboardServerFixture dashboardServerFixture)
1818
}
1919

2020
[Fact]
21-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7943")]
2221
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7943")]
2322
public async Task AppBar_Change_Theme()
2423
{
@@ -66,7 +65,6 @@ await AsyncTestHelpers.AssertIsTrueRetryAsync(
6665
}
6766

6867
[Fact]
69-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7943")]
7068
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7943")]
7169
public async Task AppBar_Change_Theme_ReloadPage()
7270
{

tests/Aspire.Dashboard.Tests/Integration/Playwright/BrowserTokenAuthenticationTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public BrowserTokenAuthenticationTests(BrowserTokenDashboardServerFixture dashbo
2929
}
3030

3131
[Fact]
32-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7921", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnGithubActions), nameof(PlatformDetection.IsWindows))]
3332
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7921")]
3433
public async Task BrowserToken_LoginPage_Success_RedirectToResources()
3534
{

tests/Aspire.Hosting.Azure.Tests/AzureCosmosDBEmulatorFunctionalTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ await pipeline.ExecuteAsync(async token =>
268268

269269
[Fact]
270270
[RequiresDocker]
271-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7178")]
272271
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7178")]
273272
public async Task AddAzureCosmosDB_RunAsEmulator_CreatesDatabase()
274273
{

tests/Aspire.Hosting.Elasticsearch.Tests/ElasticsearchFunctionalTests.cs

-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public class ElasticsearchFunctionalTests(ITestOutputHelper testOutputHelper)
2626

2727
[Fact]
2828
[RequiresDocker]
29-
[ActiveIssue("https://github.com/dotnet/aspire/issues/5821")]
3029
[QuarantinedTest("https://github.com/dotnet/aspire/issues/5821")]
3130
public async Task VerifyElasticsearchResource()
3231
{
@@ -70,7 +69,6 @@ await pipeline.ExecuteAsync(
7069
[InlineData(true)]
7170
[InlineData(false)]
7271
[RequiresDocker]
73-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7276")]
7472
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7276")]
7573
public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume)
7674
{
@@ -234,7 +232,6 @@ await pipeline.ExecuteAsync(
234232

235233
[Fact]
236234
[RequiresDocker]
237-
[ActiveIssue("https://github.com/dotnet/aspire/issues/5844")]
238235
[QuarantinedTest("https://github.com/dotnet/aspire/issues/5844")]
239236
public async Task VerifyWaitForOnElasticsearchBlocksDependentResources()
240237
{

tests/Aspire.Hosting.MongoDB.Tests/MongoDbFunctionalTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ await pipeline.ExecuteAsync(async token =>
104104
[InlineData(true)]
105105
[InlineData(false)]
106106
[RequiresDocker]
107-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7293")]
108107
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7293")]
109108
public async Task WithDataShouldPersistStateBetweenUsages(bool useVolume)
110109
{
@@ -249,7 +248,6 @@ await pipeline.ExecuteAsync(async token =>
249248

250249
[Fact]
251250
[RequiresDocker]
252-
[ActiveIssue("https://github.com/dotnet/aspire/issues/5937")]
253251
[QuarantinedTest("https://github.com/dotnet/aspire/issues/5937")]
254252
public async Task VerifyWithInitBindMount()
255253
{

tests/Aspire.Hosting.NodeJs.Tests/NodeFunctionalTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public NodeFunctionalTests(NodeAppFixture nodeJsFixture)
1818

1919
[Fact]
2020
[RequiresTools(["node"])]
21-
[ActiveIssue("https://github.com/dotnet/aspire/issues/4508", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnCI))]
2221
[QuarantinedTest("https://github.com/dotnet/aspire/issues/4508")]
2322
public async Task VerifyNodeAppWorks()
2423
{
@@ -31,7 +30,6 @@ public async Task VerifyNodeAppWorks()
3130

3231
[Fact]
3332
[RequiresTools(["npm"])]
34-
[ActiveIssue("https://github.com/dotnet/aspire/issues/4508", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnCI))]
3533
[QuarantinedTest("https://github.com/dotnet/aspire/issues/4508")]
3634
public async Task VerifyNpmAppWorks()
3735
{

tests/Aspire.Hosting.Redis.Tests/RedisFunctionalTests.cs

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public class RedisFunctionalTests(ITestOutputHelper testOutputHelper)
2525
{
2626
[Fact]
2727
[RequiresDocker]
28-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7177")]
2928
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7177")]
3029
public async Task VerifyWaitForOnRedisBlocksDependentResources()
3130
{
@@ -125,7 +124,6 @@ public async Task VerifyRedisResource()
125124

126125
[Fact]
127126
[RequiresDocker]
128-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7291")]
129127
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7291")]
130128
public async Task VerifyDatabasesAreNotDuplicatedForPersistentRedisInsightContainer()
131129
{
@@ -231,7 +229,6 @@ public async Task VerifyDatabasesAreNotDuplicatedForPersistentRedisInsightContai
231229

232230
[Fact]
233231
[RequiresDocker]
234-
[ActiveIssue("https://github.com/dotnet/aspire/issues/6099")]
235232
[QuarantinedTest("https://github.com/dotnet/aspire/issues/6099")]
236233
public async Task VerifyWithRedisInsightImportDatabases()
237234
{
@@ -540,7 +537,6 @@ public async Task PersistenceIsDisabledByDefault()
540537
[InlineData(false)]
541538
[InlineData(true)]
542539
[RequiresDocker]
543-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7176")]
544540
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7176")]
545541
public async Task RedisInsightWithDataShouldPersistStateBetweenUsages(bool useVolume)
546542
{

tests/Aspire.Hosting.Testing.Tests/TestingBuilderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ public async Task GetHttpClientBeforeStart(bool genericEntryPoint)
211211
[InlineData(false, true)]
212212
[InlineData(true, false)]
213213
[InlineData(true, true)]
214-
[ActiveIssue("https://github.com/dotnet/aspire/issues/7930", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnGithubActions), nameof(PlatformDetection.IsWindows))]
215214
[QuarantinedTest("https://github.com/dotnet/aspire/issues/7930")]
216215
public async Task ArgsPropagateToAppHostConfiguration(bool genericEntryPoint, bool directArgs)
217216
{

tests/Aspire.Hosting.Testing.Tests/TestingFactoryTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public void CanGetResources()
4646

4747
[Fact]
4848
[RequiresDocker]
49-
[ActiveIssue("https://github.com/dotnet/aspire/issues/4650", typeof(PlatformDetection), nameof(PlatformDetection.IsRunningOnCI))]
5049
[QuarantinedTest("https://github.com/dotnet/aspire/issues/4650")]
5150
public async Task HttpClientGetTest()
5251
{
@@ -70,7 +69,6 @@ public void SetsCorrectContentRoot()
7069

7170
[Fact]
7271
[RequiresDocker]
73-
[ActiveIssue("https://github.com/dotnet/aspire/issues/4650")]
7472
[QuarantinedTest("https://github.com/dotnet/aspire/issues/4650")]
7573
public async Task SelectsFirstLaunchProfile()
7674
{

tests/Aspire.Hosting.Tests/Codespaces/CodespacesUrlRewriterTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public async Task VerifyUrlsRewriterStopsWhenNotInCodespaces()
5454
}
5555

5656
[Fact]
57-
[ActiveIssue("https://github.com/dotnet/aspire/issues/6648")]
5857
[QuarantinedTest("https://github.com/dotnet/aspire/issues/6648")]
5958
public async Task VerifyUrlsRewrittenWhenInCodespaces()
6059
{

0 commit comments

Comments
 (0)