|
1 | | -name: Hiero Solo Integration Tests |
| 1 | +name: Hiero Solo Integration & Unit Tests |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - '**' |
7 | | - workflow_dispatch: |
8 | | - pull_request: |
| 7 | + pull_request: {} |
| 8 | + workflow_dispatch: {} |
9 | 9 |
|
10 | 10 | permissions: |
11 | 11 | contents: read |
@@ -62,17 +62,52 @@ jobs: |
62 | 62 |
|
63 | 63 | - name: Install your package |
64 | 64 | run: pip install -e . |
65 | | - |
66 | | - - name: Run integration tests |
| 65 | + - name: Run all integration tests |
| 66 | + id: integration |
| 67 | + continue-on-error: true |
| 68 | + shell: bash |
67 | 69 | env: |
68 | 70 | OPERATOR_ID: ${{ steps.solo.outputs.accountId }} |
69 | 71 | OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }} |
70 | 72 | ADMIN_KEY: ${{ steps.solo.outputs.privateKey }} |
71 | 73 | PUBLIC_KEY: ${{ steps.solo.outputs.publicKey }} |
72 | 74 | NETWORK: solo |
73 | 75 | run: | |
74 | | - uv run pytest -m integration |
75 | | -
|
76 | | - - name: Run unit tests |
| 76 | + set -o pipefail |
| 77 | + echo "🚀 Running integration tests..." |
| 78 | + uv run pytest tests/integration -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_integration.log |
| 79 | + pytest_exit=${PIPESTATUS[0]} |
| 80 | + echo "integration_failed=$pytest_exit" >> "$GITHUB_OUTPUT" |
| 81 | + cat result_integration.log |
| 82 | + if [ $pytest_exit -ne 0 ]; then |
| 83 | + echo "❌ Some integration tests failed" |
| 84 | + else |
| 85 | + echo "✅ All integration tests passed" |
| 86 | + fi |
| 87 | +
|
| 88 | + - name: Run all unit tests |
| 89 | + id: unit |
| 90 | + continue-on-error: true |
| 91 | + shell: bash |
| 92 | + run: | |
| 93 | + set -o pipefail |
| 94 | + echo "🚀 Running unit tests..." |
| 95 | + uv run pytest tests/unit -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_unit.log |
| 96 | + pytest_exit=${PIPESTATUS[0]} |
| 97 | + echo "unit_failed=$pytest_exit" >> "$GITHUB_OUTPUT" |
| 98 | + cat result_unit.log |
| 99 | + if [ $pytest_exit -ne 0 ]; then |
| 100 | + echo "❌ Some unit tests failed" |
| 101 | + else |
| 102 | + echo "✅ All unit tests passed" |
| 103 | + fi |
| 104 | +
|
| 105 | + - name: Fail workflow if any tests failed |
| 106 | + shell: bash |
77 | 107 | run: | |
78 | | - uv run pytest -m unit |
| 108 | + if [ "${{ steps.integration.outputs.integration_failed }}" != "0" ] || [ "${{ steps.unit.outputs.unit_failed }}" != "0" ]; then |
| 109 | + echo "❌ Some tests failed. Failing workflow." |
| 110 | + exit 1 |
| 111 | + else |
| 112 | + echo "✅ All tests passed!" |
| 113 | + fi |
0 commit comments