Skip to content

Patch 1 #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
14 changes: 4 additions & 10 deletions .github/workflows/codeql_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:
id: cache-codeql
uses: actions/cache@v4
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: ${{github.workspace}}/codeql_home
# An explicit key for restoring and saving the cache
key: codeql-home-${{matrix.os}}-${{matrix.codeql_cli}}-${{matrix.codeql_standard_library}}

- name: Install CodeQL
Expand All @@ -83,7 +81,6 @@ jobs:
run: |
${{ github.workspace }}/codeql_home/codeql/codeql query compile --threads 0 ${{ matrix.language }}


- name: Run test suites
id: run-test-suites
env:
Expand Down Expand Up @@ -124,7 +121,6 @@ jobs:
print(f"Executing tests found (recursively) in the directory '{test_root}'")
files_to_close = []
try:
# XL runners have 8 cores, so split the tests into 8 "slices", and run one per thread
num_slices = 8
procs = []

Expand All @@ -139,12 +135,8 @@ jobs:
_, err = p.communicate()
if p.returncode != 0:
if p.returncode == 122:
# Failed because a test case failed, so just print the regular output.
# This will allow us to proceed to validate-test-results, which will fail if
# any test cases failed
print(f"{err.decode()}")
else:
# Some more serious problem occurred, so print and fail fast
print_error_and_fail(f"Failed to run tests with return code {p.returncode}\n{err.decode()}")
finally:
for file in files_to_close:
Expand All @@ -170,18 +162,20 @@ jobs:
with:
script: |
core.setFailed('Test run job failed')

- name: Collect test results
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5

- name: Validate test results
run: |
for json_report in *-test-results-*/test_report_*
do
jq --raw-output '"PASS \(map(select(.pass == true)) | length)/\(length)'" $json_report\"" "$json_report"
jq --raw-output 'PASS \(map(select(.pass == true)) | length)/\(length)' $json_report
done
FAILING_TESTS=$(jq --raw-output '.[] | select(.pass == false)' *-test-results-*/test_report_*.json)
if [[ ! -z "$FAILING_TESTS" ]]; then
echo "ERROR: The following tests failed:"
echo $FAILING_TESTS | jq .
exit 1
fi

2 changes: 1 addition & 1 deletion .github/workflows/standard_library_upgrade_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
python-version: "3.9"

- name: Collect test results
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5

- name: Validate test results
shell: python
Expand Down