Skip to content
Merged
Changes from 6 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
46 changes: 37 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,49 @@ jobs:
- uses: taiki-e/install-action@v2
with:
tool: nextest
- name: "Test (nextest)"
- name: Test (nextest)
id: nextest
env:
GIX_TEST_IGNORE_ARCHIVES: 1
GIX_TEST_IGNORE_ARCHIVES: '1'
run: cargo nextest --profile=with-xml run --workspace --no-fail-fast
continue-on-error: true
- name: Check how many tests failed
if: steps.nextest.outcome == 'failure'
- name: Check for errors
run: |
[xml]$junit_xml = Get-Content -Path 'target/nextest/with-xml/junit.xml'
if ($junit_xml.testsuites.errors -ne 0) { exit 1 }
- name: Collect actual failures
run: |
[xml]$junit_xml = Get-Content -Path 'target/nextest/with-xml/junit.xml'

$actual_failures = $junit_xml.SelectNodes("//testcase[failure]") |
ForEach-Object { "$($_.classname) $($_.name)" } |
Sort-Object

Write-Output $actual_failures
Set-Content -Path 'actual-failures.txt' -Value $actual_failures
- name: Collect expected failures
env:
# See https://github.com/GitoxideLabs/gitoxide/issues/1358.
EXPECTED_FAILURE_COUNT: 14
GH_TOKEN: ${{ github.token }}
run: |
$issue = 1358 # https://github.com/GitoxideLabs/gitoxide/issues/1358

$match_info = gh issue --repo GitoxideLabs/gitoxide view $issue --json body --jq .body |
Out-String |
Select-String -Pattern '(?s)```text\r?\n(.*?)```'

$expected_failures = $match_info.Matches.Groups[1].Value -split "`n" |
Where-Object { ($_ -match '^\s*FAIL \[') -and ($_ -notmatch '\bperformance\b') } |
ForEach-Object { $_ -replace '^\s*FAIL \[\s*\d+\.\d+s\]\s*', '' -replace '\s+$', '' } |
Sort-Object

Write-Output $expected_failures
Set-Content -Path 'expected-failures.txt' -Value $expected_failures
- name: Compare expected and actual failures
run: |
[xml]$junit = Get-Content -Path 'target/nextest/with-xml/junit.xml'
if ($junit.testsuites.errors -ne 0) { exit 1 }
if ($junit.testsuites.failures -gt $env:EXPECTED_FAILURE_COUNT) { exit 1 }
# Fail on any differences, even unexpectedly passing tests, so they can be investigated.
# (If the job is made blocking for PRs, it may make sense to make this less stringent.)
git --no-pager diff --no-index --exit-code --unified=1000000 --color=always -- `
expected-failures.txt actual-failures.txt

test-32bit:
runs-on: ubuntu-latest
Expand Down
Loading