Skip to content

Commit 4f874cf

Browse files
authored
chore: log import errors on solo workflow (hiero-ledger#741)
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent 0bf5a9c commit 4f874cf

File tree

2 files changed

+45
-9
lines changed

2 files changed

+45
-9
lines changed

.github/workflows/test.yml

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Hiero Solo Integration Tests
1+
name: Hiero Solo Integration & Unit Tests
22

33
on:
44
push:
55
branches:
66
- '**'
7-
workflow_dispatch:
8-
pull_request:
7+
pull_request: {}
8+
workflow_dispatch: {}
99

1010
permissions:
1111
contents: read
@@ -62,17 +62,52 @@ jobs:
6262
6363
- name: Install your package
6464
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
6769
env:
6870
OPERATOR_ID: ${{ steps.solo.outputs.accountId }}
6971
OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }}
7072
ADMIN_KEY: ${{ steps.solo.outputs.privateKey }}
7173
PUBLIC_KEY: ${{ steps.solo.outputs.publicKey }}
7274
NETWORK: solo
7375
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
77107
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

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
2929
- Update github actions checkout from 5.0.0 to 5.0.1 (#814)
3030

3131
### Fixed
32+
- chore: fix test.yml workflow to log import errors (#740)
3233
- chore: fixed integration test names without a test prefix or postfix
3334

3435

0 commit comments

Comments
 (0)