Verbose logging for fault injection (#2375)

* Verbose logging for fault injection

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

* Switch upload crash dumps to 'always'

Signed-off-by: Alan Jowett <alanjo@microsoft.com>

---------

Signed-off-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Alan Jowett 2023-04-25 19:00:24 -06:00 коммит произвёл GitHub
Родитель 83567d6270
Коммит 7825cd9cad
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 6 удалений

4
.github/workflows/reusable-test.yml поставляемый
Просмотреть файл

@ -301,7 +301,7 @@ jobs:
- name: Check for crash dumps
# Check for crash dumps even if the workflow failed.
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true')
if: always() && (steps.skip_check.outputs.should_skip != 'true')
uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b
id: check_dumps
with:
@ -309,7 +309,7 @@ jobs:
- name: Upload any crash dumps
# Upload crash dumps even if the workflow failed.
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (steps.check_dumps.outputs.files_exists == 'true') && (inputs.gather_dumps == true)
if: always() && (steps.skip_check.outputs.should_skip != 'true') && (steps.check_dumps.outputs.files_exists == 'true') && (inputs.gather_dumps == true)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
id: upload_crash_dumps
with:

Просмотреть файл

@ -17,15 +17,15 @@ $tests = & $TestProgram "--list-tests" "--verbosity=quiet"
$env:EBPF_FAULT_INJECTION_SIMULATION = $StackDepth
$env:EBPF_ENABLE_WER_REPORT = "yes"
Set-Content -Path ($TestProgram +".passed.log") ""
Set-Content -Path ($TestProgram +".fault.log") ""
Set-Content -Path ($TestProgram + ".passed.log") ""
Set-Content -Path ($TestProgram + ".fault.log") ""
$iteration = 0
# Rerun failing tests until they pass
while ($true) {
$previous_passed_tests = $passed_tests
$passed_tests = Get-Content -Path ($TestProgram +".passed.log")
$passed_tests = Get-Content -Path ($TestProgram + ".passed.log")
# Get the list of tests that have passed in the previous iteration.
$passed_tests | Where-Object { $_ -notin $previous_passed_tests } | ForEach-Object { Write-Host "Passed: $_" }
@ -46,7 +46,7 @@ while ($true) {
$remaining_tests | ForEach-Object { write-host "Running: $_" }
# Run the test binary with any remaining tests.
$log = (& $TestProgram "-d yes" "--verbosity=quiet" "-f remaining_tests.txt" 2>&1)
& $TestProgram "-d yes" "--verbosity=quiet" "-f remaining_tests.txt"
if ($LASTEXITCODE -eq 0) {
write-host "All tests passed"