Skip to content

Commit 17a61ee

Browse files
committed
Revert
1 parent 8c86e4a commit 17a61ee

1 file changed

Lines changed: 40 additions & 66 deletions

File tree

.github/workflows/push.yml

Lines changed: 40 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ jobs:
132132
echo "dotnetExecutable: ${{ env.dotnetExecutable }}"
133133
134134
echo "github.event_name: ${{ github.event_name }}"
135-
136135
echo "github.repository: ${{ github.repository }}"
137136
- name: .NET Information Before SDK Install
138137
shell: pwsh
@@ -236,49 +235,44 @@ jobs:
236235
if: always() && env.skipTests != 'true'
237236
shell: pwsh
238237
run: |
239-
$env:EFCoreJet_DefaultConnection = '${{ env.defaultConnection }}'
240-
241-
$filters = @(
242-
'FullyQualifiedName~.A|FullyQualifiedName~.B|FullyQualifiedName~.C|FullyQualifiedName~.D|FullyQualifiedName~.E|FullyQualifiedName~.F|FullyQualifiedName~.G|FullyQualifiedName~.H|FullyQualifiedName~.I|FullyQualifiedName~.J|FullyQualifiedName~.K|FullyQualifiedName~.L|FullyQualifiedName~.M',
243-
'FullyQualifiedName~.N|FullyQualifiedName~.O|FullyQualifiedName~.P|FullyQualifiedName~.Q|FullyQualifiedName~.R|FullyQualifiedName~.S|FullyQualifiedName~.T|FullyQualifiedName~.U|FullyQualifiedName~.V|FullyQualifiedName~.W|FullyQualifiedName~.X|FullyQualifiedName~.Y|FullyQualifiedName~.Z'
244-
)
238+
for ($i = 0; $i -lt 3; $i++) {
239+
if (Test-Path '.\test\EFCore.Jet.FunctionalTests\TestResults' -PathType Container) {
240+
Get-ChildItem '.\test\EFCore.Jet.FunctionalTests\TestResults' | Remove-Item -Recurse -Force
241+
}
245242
246-
for ($shard = 0; $shard -lt $filters.Count; $shard++) {
247-
for ($i = 0; $i -lt 3; $i++) {
248-
$resultsDir = ".\test\EFCore.Jet.FunctionalTests\TestResults\shard_$shard"
249-
if (Test-Path $resultsDir -PathType Container) {
250-
Get-ChildItem $resultsDir | Remove-Item -Recurse -Force
251-
} else {
252-
New-Item -ItemType Directory -Path $resultsDir | Out-Null
253-
}
243+
$env:EFCoreJet_DefaultConnection = '${{ env.defaultConnection }}'
244+
& '${{ env.dotnetExecutable }}' test .\test\EFCore.Jet.FunctionalTests --configuration '${{ env.buildConfiguration }}' -p:FixedTestOrder=${{ env.deterministicTests }} --logger trx --verbosity detailed --blame-hang-timeout 3m
254245
255-
& '${{ env.dotnetExecutable }}' test .\test\EFCore.Jet.FunctionalTests --configuration '${{ env.buildConfiguration }}' -p:FixedTestOrder=${{ env.deterministicTests }} --logger trx --verbosity detailed --blame-hang-timeout 3m --results-directory $resultsDir --filter "$($filters[$shard])"
246+
#
247+
# Check for test runner crashes:
248+
#
256249
257-
$currentTestRunTrx = Get-ChildItem $resultsDir -Filter '*.trx' | Sort-Object LastWriteTime | Select-Object -Last 1
258-
if ($null -eq $currentTestRunTrx) {
259-
echo 'Test runner log file is missing.'
260-
exit 3
261-
}
250+
$testResultsDir = '.\test\EFCore.Jet.FunctionalTests\TestResults'
251+
$currentTestRunTrx = Get-ChildItem $testResultsDir -Filter '*.trx' | Sort-Object LastWriteTime | Select-Object -Last 1
252+
if ($null -eq $currentTestRunTrx) {
253+
echo 'Test runner log file is missing.'
254+
exit 3
255+
}
262256
263-
$currentTestRunDir = Join-Path $resultsDir $currentTestRunTrx.BaseName
264-
if (Test-Path $currentTestRunDir) {
265-
if ($null -ne (Get-ChildItem $currentTestRunDir -Filter 'Sequence_*' -Recurse)) {
257+
$currentTestRunDir = Join-Path $testResultsDir $currentTestRunTrx.BaseName
258+
if (Test-Path $currentTestRunDir) {
259+
if ($null -ne (Get-ChildItem $currentTestRunDir -Filter 'Sequence_*' -Recurse)) {
266260
# Split string because searching the log for that phrase should only show actual crashes and not this line.
267-
echo ('Test runner cras' + 'hed.')
268-
continue
269-
}
261+
echo ('Test runner cras' + 'hed.')
262+
continue
270263
}
271-
272-
echo "Shard $shard: Test runner ran until the end."
273-
break
274264
}
275265
276-
$establishedGreenTestsFilePath = ".\test\EFCore.Jet.FunctionalTests\GreenTests\ace_${{ matrix.aceVersion }}_$('${{ matrix.dataAccessProviderType }}'.Replace(' ', '').ToLowerInvariant())_${{ matrix.aceArchitecture }}.txt"
277-
$failIfKeepsCrashing = Test-Path $establishedGreenTestsFilePath
278-
if ($i -ge 3 -and $failIfKeepsCrashing) {
279-
echo "Shard $shard: Test runner keeps crashing."
280-
exit 2
281-
}
266+
echo 'Test runner ran until the end.'
267+
break
268+
}
269+
270+
$establishedGreenTestsFilePath = ".\test\EFCore.Jet.FunctionalTests\GreenTests\ace_${{ matrix.aceVersion }}_$('${{ matrix.dataAccessProviderType }}'.Replace(' ', '').ToLowerInvariant())_${{ matrix.aceArchitecture }}.txt"
271+
$failIfKeepsCrashing = Test-Path $establishedGreenTestsFilePath
272+
273+
if ($i -ge 3 -and $failIfKeepsCrashing) {
274+
echo 'Test runner keeps crashing.'
275+
exit 2
282276
}
283277
exit 0
284278
- name: 'Rename Test Results'
@@ -299,39 +293,19 @@ jobs:
299293
if: env.skipTests != 'true'
300294
shell: pwsh
301295
run: |
302-
# Aggregate all shard trx files and compute combined passed tests
303-
$testResultsRoot = '.\test\EFCore.Jet.FunctionalTests\TestResults'
304-
$trxFiles = Get-ChildItem $testResultsRoot -Recurse -Filter '*.trx' | Sort-Object LastWriteTime
296+
# Create text file with all tests that passed.
297+
$testResultsDir = '.\test\EFCore.Jet.FunctionalTests\TestResults'
298+
$currentTestRunTrx = Get-ChildItem $testResultsDir -Filter '*.trx' | Sort-Object LastWriteTime | Select-Object -Last 1
305299
306-
if ($null -eq $trxFiles -or $trxFiles.Count -eq 0) {
307-
echo 'Test runner log files are missing.'
300+
if ($null -eq $currentTestRunTrx) {
301+
echo 'Test runner log file is missing.'
308302
exit 3
309303
}
310304
311-
# Use the latest file's directory as output location for convenience
312-
$latestTrx = $trxFiles | Select-Object -Last 1
313-
$outputDir = $latestTrx.DirectoryName
314-
315-
$allTestsFilePath = Join-Path $outputDir ($latestTrx.BaseName + '_All_Aggregated.txt')
316-
if (Test-Path $allTestsFilePath) { Remove-Item $allTestsFilePath -Force }
317-
318-
foreach ($trx in $trxFiles) {
319-
$nodes = Select-Xml -Path $trx.FullName -XPath "//ns:UnitTestResult" -Namespace @{"ns"="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"}
320-
$nodes.Node | ForEach-Object {
321-
$status = if ($_.outcome -eq 'Passed') { 'P' } elseif ($_.outcome -eq 'NotExecuted') { 'N' } elseif ($_.outcome -eq 'Failed') { 'F' } else { 'U' }
322-
"$status $($_.testName)" | Add-Content $allTestsFilePath
323-
}
324-
}
325-
326-
# Deduplicate while preserving order
327-
$seen = @{
328-
}
329-
$dedupedAll = foreach ($line in Get-Content $allTestsFilePath) { if (-not $seen.ContainsKey($line)) { $seen[$line] = $true; $line } }
330-
Set-Content $allTestsFilePath $dedupedAll
305+
$allTestsFilePath = Join-Path $currentTestRunTrx.DirectoryName ($currentTestRunTrx.BaseName + '_All.txt')
306+
(Select-Xml -Path $currentTestRunTrx.FullName -XPath "//ns:UnitTestResult" -Namespace @{"ns"="http://microsoft.com/schemas/VisualStudio/TeamTest/2010"}).Node | Sort-Object -Property testName -CaseSensitive | ForEach-Object { "$($_.outcome -eq 'Passed' ? 'P' : $_.outcome -eq 'NotExecuted' ? 'N' : $_.outcome -eq 'Failed' ? 'F' : 'U') $($_.testName)" } | Add-Content $allTestsFilePath
331307
332-
# Build combined passed list
333-
$greenTestsFilePath = Join-Path $outputDir ($latestTrx.BaseName + '_Passed_Aggregated.txt')
334-
if (Test-Path $greenTestsFilePath) { Remove-Item $greenTestsFilePath -Force }
308+
$greenTestsFilePath = Join-Path $currentTestRunTrx.DirectoryName ($currentTestRunTrx.BaseName + '_Passed.txt')
335309
Get-Content $allTestsFilePath | Where-Object { $_.StartsWith('P ') } | ForEach-Object { $_.Substring(2) } | Add-Content $greenTestsFilePath
336310
337311
# Compare test file against previously committed file.
@@ -341,7 +315,7 @@ jobs:
341315
$diffResult = Compare-Object (Get-Content $establishedGreenTestsFilePath) (Get-Content $greenTestsFilePath)
342316
343317
$notGreenAnymore = $diffResult | Where-Object { $_.SideIndicator -eq '<=' } | Select-Object -ExpandProperty InputObject
344-
if ($null -ne $notGreenAnymore -and $notGreenAnymore.Count -gt 0) {
318+
if ($null -ne $notGreenAnymore) {
345319
echo "`nThe following $(@($notGreenAnymore).Length) tests passed in previous runs, but didn't pass in this run:`n"
346320
$notGreenAnymore
347321
exit 1
@@ -350,7 +324,7 @@ jobs:
350324
echo 'All tests that passed in previous runs still passed in this run.'
351325
352326
$newlyGreenTests = $diffResult | Where-Object { $_.SideIndicator -eq '=>' } | Select-Object -ExpandProperty InputObject
353-
if ($newlyGreenTests -and $newlyGreenTests.Length -gt 0) {
327+
if ($newlyGreenTests.Length -gt 0) {
354328
Copy-Item $greenTestsFilePath $establishedGreenTestsFilePath -Force -Verbose
355329
356330
echo "`nThe following new tests passed that did not pass before:`n"

0 commit comments

Comments
 (0)