Skip to content

Commit 6515bba

Browse files
committed
update spec test execute
1 parent 0cf058a commit 6515bba

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

playbooks/dev/execution-spec-tests-execute.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,26 @@ tasks:
179179
curl -o ${ASSERTOOR_RESULT_DIR}/assets/style.css https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/master/res/execution-spec-tests-styles.css
180180
181181
REPORT_JSON=$(cat report.json | jq -c '[.tests[] | {"nodeid": .nodeid, "outcome": .outcome, "setupDuration": .setup.duration, "callDuration": .call.duration, "teardownDuration": .teardown.duration}]')
182+
TOTAL_TESTS=$(echo "$REPORT_JSON" | jq '. | length')
183+
PASSED_TESTS=$(echo "$REPORT_JSON" | jq '[.[] | select(.outcome == "passed")] | length')
184+
echo "Total tests: $TOTAL_TESTS"
185+
echo "Passed tests: $PASSED_TESTS"
182186
183-
echo "::set-output-json reportJSON ${REPORT_JSON}"
187+
# Check if tests passed
188+
echo "::set-output passedTests ${PASSED_TESTS}"
189+
echo "::set-output totalTests ${TOTAL_TESTS}"
184190
185191
exit 0
186192
193+
- name: run_shell
194+
title: "Check test results (${tasks.execute.outputs.passedTests} / ${tasks.execute.outputs.totalTests} passed)"
195+
id: check
196+
if: runTests
197+
config:
198+
shell: bash
199+
command: |
200+
set -e
201+
if [ "${tasks.execute.outputs.passedTests}" -ne "${tasks.execute.outputs.totalTests}" ]; then
202+
echo "Some tests failed, see report.html in the task above for details"
203+
exit 1
204+
fi

0 commit comments

Comments
 (0)