Skip to content

Commit

Permalink
Adding number of passed and failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AnHeuermann committed Jan 8, 2024
1 parent aa25909 commit 0008f80
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ jobs:
reference-files-format: csv
reference-files-delimiter: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test openmodelica-library-testing
shell: bash
run: |
echo "simulation-tests-passing: ${{ steps.check_results.outputs.simulation-tests-passing }}"
echo "verification-tests-passing: ${{ steps.check_results.outputs.verification-tests-passing }}"
if [${{ steps.check_results.outputs.simulation-tests-passing }}] && [ ${{ steps.check_results.outputs.n-simulation-passing }} == 2 ] && [${{ steps.check_results.outputs.verification-tests-passing }}] && ! [ ${{ steps.check_results.outputs.n-simulation-passing }} == 1 ]; then
exit 0;
else
exit 1;
fi
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Version of OpenModelica to use for testing.
Check
[AnHeuermann/setup-openmodelica](https://github.com/AnHeuermann/setup-openmodelica#available-openmodelica-versions)
for available versions.\
Default: `'stable`
Default: `'stable'`

### `reference-files-dir`

Expand Down Expand Up @@ -84,10 +84,18 @@ jobs:

True if all simulation tests are passing.

## ` n-simulation-passing`

Number of successful simulation tests.

## `verification-tests-passing`

True if all verification tests are passing.

## `n-verification-passing`

Number of successful verification tests.

## Artifacts

### HTML Results
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@ outputs:
simulation-tests-passing:
description: 'True if all simulation tests are passing'
value: ${{ steps.check_results.outputs.simulation-tests-passing }}
n-simulation-passing:
description: 'Number of successful simulation tests'
value: ${{ steps.check_results.outputs.n-simulation-passing }}
verification-tests-passing:
description: 'True if all verification tests are passing'
value: ${{ steps.check_results.outputs.verification-tests-passing }}
n-verification-passing:
description: 'Number of successful verification tests'
value: ${{ steps.check_results.outputs.n-verification-passing }}

runs:
using: "composite"
Expand Down
2 changes: 2 additions & 0 deletions scripts/checkTestResults.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def getTestResults(htmlFile, testVerification):
output_file = os.getenv('GITHUB_OUTPUT')
with open(output_file, "a") as f:
f.write(f"simulation-tests-passing={simSuccess}\n")
f.write(f"n-simulation-passing={overview['Simulation'][0]}\n")
f.write(f"verification-tests-passing={testVerification and not verificationSuccess}")
f.write(f"n-verification-passing={overview['Verification'][0]}")

return 0

Expand Down

0 comments on commit 0008f80

Please sign in to comment.