Skip to content

Commit 6b9bb5c

Browse files
authored
fix: remove test default to no failure if empty (#1036)
Signed-off-by: exploreriii <133720349+exploreriii@users.noreply.github.com>
1 parent eab5ea7 commit 6b9bb5c

File tree

2 files changed

+58
-8
lines changed

2 files changed

+58
-8
lines changed

.github/workflows/test.yml

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Hiero Solo Integration & Unit Tests
33
on:
44
push:
55
branches:
6-
- '**'
6+
- "**"
77
pull_request: {}
88
workflow_dispatch: {}
99

@@ -33,7 +33,7 @@ jobs:
3333
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
3434
with:
3535
python-version: ${{ matrix.python-version }}
36-
cache: 'pip'
36+
cache: "pip"
3737

3838
- name: Install uv
3939
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
@@ -62,6 +62,11 @@ jobs:
6262
6363
- name: Install your package
6464
run: pip install -e .
65+
66+
##############################################
67+
# INTEGRATION TESTS
68+
##############################################
69+
6570
- name: Run all integration tests
6671
id: integration
6772
continue-on-error: true
@@ -77,14 +82,20 @@ jobs:
7782
echo "🚀 Running integration tests..."
7883
uv run pytest tests/integration -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_integration.log
7984
pytest_exit=${PIPESTATUS[0]}
80-
echo "integration_failed=$pytest_exit" >> "$GITHUB_OUTPUT"
85+
echo "integration_failed=$pytest_exit" >> $GITHUB_OUTPUT
8186
cat result_integration.log
8287
if [ $pytest_exit -ne 0 ]; then
8388
echo "❌ Some integration tests failed"
89+
echo "Failed tests:"
90+
grep -E 'FAILED ' result_integration.log || true
8491
else
8592
echo "✅ All integration tests passed"
8693
fi
8794
95+
##############################################
96+
# UNIT TESTS
97+
##############################################
98+
8899
- name: Run all unit tests
89100
id: unit
90101
continue-on-error: true
@@ -94,25 +105,62 @@ jobs:
94105
echo "🚀 Running unit tests..."
95106
uv run pytest tests/unit -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_unit.log
96107
pytest_exit=${PIPESTATUS[0]}
97-
echo "unit_failed=$pytest_exit" >> "$GITHUB_OUTPUT"
108+
echo "unit_failed=$pytest_exit" >> $GITHUB_OUTPUT
98109
cat result_unit.log
99110
if [ $pytest_exit -ne 0 ]; then
100111
echo "❌ Some unit tests failed"
112+
echo "Failed tests:"
113+
grep -E 'FAILED ' result_unit.log || true
101114
else
102115
echo "✅ All unit tests passed"
103116
fi
104117
118+
##############################################
119+
# SUMMARY & FAIL CONDITIONS
120+
##############################################
121+
105122
- name: Fail workflow if any tests failed
106123
shell: bash
107124
run: |
108125
integration_failed="${{ steps.integration.outputs.integration_failed }}"
109126
unit_failed="${{ steps.unit.outputs.unit_failed }}"
110127
111-
# Default to 0 if empty
112-
integration_failed="${integration_failed:-0}"
113-
unit_failed="${unit_failed:-0}"
128+
echo ""
129+
echo "==================== TEST SUMMARY ===================="
130+
131+
any_failed=false
132+
133+
if [ "$integration_failed" != "0" ]; then
134+
echo "❌ Integration tests FAILED"
135+
echo " → Check the integration test logs above for details."
136+
if [ -f result_integration.log ]; then
137+
grep -E 'FAILED ' result_integration.log || echo " (No FAILED lines found)"
138+
else
139+
echo " (Integration log not found)"
140+
fi
141+
any_failed=true
142+
else
143+
echo "✅ Integration tests passed"
144+
fi
145+
146+
if [ "$unit_failed" != "0" ]; then
147+
echo "❌ Unit tests FAILED"
148+
echo " → Check the unit test logs above for details."
149+
if [ -f result_unit.log ]; then
150+
grep -E 'FAILED ' result_unit.log || echo " (No FAILED lines found)"
151+
else
152+
echo " (Unit log not found)"
153+
fi
154+
any_failed=true
155+
else
156+
echo "✅ Unit tests passed"
157+
fi
158+
159+
echo "======================================================"
160+
echo ""
114161
115-
if [ "$integration_failed" != "0" ] || [ "$unit_failed" != "0" ]; then
162+
# Final outcome
163+
if [ "$any_failed" = true ]; then
116164
echo "❌ Some tests failed. Failing workflow."
117165
exit 1
118166
else

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
3838
- Allow `PublicKey` for `TokenUpdateKeys` in `TokenUpdateTransaction`, enabling non-custodial workflows where operators can build transactions using only public keys (#934).
3939
- Bump protobuf toml to protobuf==6.33.2
4040
- Added more tests to the CustomFee class for different functionalities (#991)
41+
- Changed messaged for test failure summaries so it is clearer by extracting test failure names into summary
4142

4243
### Fixed
4344

4445
- Fixed inactivity bot workflow not checking out repository before running (#964)
4546
- Fixed the topic_message_query integarion test
4647
- good first issue template yaml rendering
48+
- Fixed solo workflow defaulting to zero
4749

4850
### Breaking Change
4951

0 commit comments

Comments
 (0)