mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 10:36:22 +00:00
ci: improve test failure detection in parallel tests
1. ci-build.sh: Add verify_test_failure_detection() function - Tests that single test failures are properly detected - Tests that parallel test failures are properly detected - Runs at CI start to catch framework issues early 2. Makefile.am: Fix check-functional-parallel exit code handling - OLD: used 'wait' without checking individual exit codes - NEW: capture each PID and check exit code with 'wait $pid' - On failure: print the log file and set failed flag - Exit with error if any group failed This ensures CI correctly fails when: - Any unit test fails - Any of the 4 functional test groups fails - Any parallel build configuration fails
This commit is contained in:
24
Makefile.am
24
Makefile.am
@@ -311,17 +311,19 @@ tests_functionaltests_functionaltests_LDADD = -lcmocka -lstabber @FORKPTY_LIB@
|
||||
check-functional-parallel: tests/functionaltests/functionaltests
|
||||
@echo "Running functional tests in parallel (4 groups)..."
|
||||
@mkdir -p $(builddir)/test-logs
|
||||
@( \
|
||||
./tests/functionaltests/functionaltests 1 > $(builddir)/test-logs/group1.log 2>&1 & \
|
||||
./tests/functionaltests/functionaltests 2 > $(builddir)/test-logs/group2.log 2>&1 & \
|
||||
./tests/functionaltests/functionaltests 3 > $(builddir)/test-logs/group3.log 2>&1 & \
|
||||
./tests/functionaltests/functionaltests 4 > $(builddir)/test-logs/group4.log 2>&1 & \
|
||||
wait \
|
||||
) && ( \
|
||||
echo "=== Test Results ==="; \
|
||||
grep -E 'PASSED|FAILED|Running' $(builddir)/test-logs/group*.log; \
|
||||
! grep -q FAILED $(builddir)/test-logs/group*.log \
|
||||
)
|
||||
@failed=0; \
|
||||
./tests/functionaltests/functionaltests 1 > $(builddir)/test-logs/group1.log 2>&1 & pid1=$$!; \
|
||||
./tests/functionaltests/functionaltests 2 > $(builddir)/test-logs/group2.log 2>&1 & pid2=$$!; \
|
||||
./tests/functionaltests/functionaltests 3 > $(builddir)/test-logs/group3.log 2>&1 & pid3=$$!; \
|
||||
./tests/functionaltests/functionaltests 4 > $(builddir)/test-logs/group4.log 2>&1 & pid4=$$!; \
|
||||
wait $$pid1 || { echo "Group 1 FAILED (exit $$?)"; cat $(builddir)/test-logs/group1.log; failed=1; }; \
|
||||
wait $$pid2 || { echo "Group 2 FAILED (exit $$?)"; cat $(builddir)/test-logs/group2.log; failed=1; }; \
|
||||
wait $$pid3 || { echo "Group 3 FAILED (exit $$?)"; cat $(builddir)/test-logs/group3.log; failed=1; }; \
|
||||
wait $$pid4 || { echo "Group 4 FAILED (exit $$?)"; cat $(builddir)/test-logs/group4.log; failed=1; }; \
|
||||
echo "=== Test Results Summary ==="; \
|
||||
grep -E 'PASSED|FAILED|Running' $(builddir)/test-logs/group*.log || true; \
|
||||
if [ $$failed -ne 0 ]; then echo "FUNCTIONAL TESTS FAILED"; exit 1; fi; \
|
||||
echo "All functional test groups passed!"
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user