From 97920f9fc3650c93bd1f55beea8426d49419876b Mon Sep 17 00:00:00 2001 From: Trung Nguyen Date: Mon, 30 Sep 2024 15:15:30 -0500 Subject: [PATCH] try again with the github step summary --- .github/workflows/quick-regression.yml | 12 ++++++++++-- tools/regression-tests/run_tests.py | 7 ++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/quick-regression.yml b/.github/workflows/quick-regression.yml index 88794bfa0a..f1d67f8727 100644 --- a/.github/workflows/quick-regression.yml +++ b/.github/workflows/quick-regression.yml @@ -95,7 +95,7 @@ jobs: --list-input=input-list-${{ matrix.idx }}.txt \ --output-file=output-${{ matrix.idx }}.xml \ --progress-file=progress-${{ matrix.idx }}.yaml \ - --log-file=run-${{ matrix.idx }}.log + --log-file=run-${{ matrix.idx }}.log > screen.${{ matrix.idx }} fi tar -cvf quick-regression-test-${{ matrix.idx }}.tar run-${{ matrix.idx }}.log progress-${{ matrix.idx }}.yaml output-${{ matrix.idx }}.xml @@ -106,6 +106,12 @@ jobs: name: quick-regression-test-artifact-${{ matrix.idx }} path: quick-regression-test-${{ matrix.idx }}.tar + - name: Upload screen output + uses: actions/upload-artifact@v4 + with: + name: screen-output-${{ matrix.idx }} + path: screen.${{ matrix.idx }} + merge: runs-on: ubuntu-latest needs: build @@ -115,4 +121,6 @@ jobs: with: name: merged-quick-regresssion-artifact pattern: quick-regression-test-artifact-* - + - name: Print job summary + run: | + grep Failed screen.* | tr -d '\n' > $GITHUB_STEP_SUMMARY diff --git a/tools/regression-tests/run_tests.py b/tools/regression-tests/run_tests.py index 1faa45d94c..32b89bd27c 100755 --- a/tools/regression-tests/run_tests.py +++ b/tools/regression-tests/run_tests.py @@ -1521,15 +1521,16 @@ if __name__ == "__main__": msg += f" - Completed: {completed_tests}\n" # print notice to GitHub - with open(os.environ.get('GITHUB_STEP_SUMMARY'), 'w') as f: - print(f"Skipped: {skipped_tests} Failed: {error_tests} Completed: {completed_tests}", file=f) + if 'GITHUB_STEP_SUMMARY' in os.environ: + with open(os.environ.get('GITHUB_STEP_SUMMARY'), 'w') as f: + print(f"Skipped: {skipped_tests} Failed: {error_tests} Completed: {completed_tests}", file=f) if memleak_tests < completed_tests and 'valgrind' in config['mpiexec']: msg += f" - memory leak detected : {memleak_tests}\n" if passed_tests <= completed_tests: msg += f" - numerical tests passed: {passed_tests}\n" msg += "\nOutput:\n" - msg += f" - Failed inputs and reasons : {failure_file}\n" + msg += f" - List of failed inputs : {failure_file}\n" msg += f" - Status of the tested inputs : {progress_file}\n" msg += f" - Running log with screen output: {log_file}\n" msg += f" - Testing result in JUnit XML : {output_file}\n"