@@ -33,20 +33,31 @@ jobs:
3333 - uses : actions/checkout@v4
3434 name : Checkout repository
3535
36- - name : Run Tests
36+ - name : Run build and tests
3737 run : |
38- ${{ matrix.config }} ${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh || {
39- if [ -n "${{ matrix.force_fail }}" ]; then
40- cp test-suite.log test-suite-force-fail.log || true
41- echo "Test failed as expected with force fail enabled"
42- exit 0 # failure was expected (force fail)
38+ # Build first with matrix config
39+ ${{ matrix.config }} ${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh
40+ BUILD_RESULT=$?
41+
42+ # Run all tests regardless of build result
43+ ${{ matrix.force_fail }} ./scripts/cmd_test/do-cmd-tests.sh
44+ TEST_RESULT=$?
45+
46+ # For force_fail, we expect failures (return 1)
47+ if [ -n "${{ matrix.force_fail }}" ]; then
48+ if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
49+ echo "Build/Test unexpectedly succeeded with force fail enabled"
50+ exit 1 # failure was not seen when expected
4351 else
44- exit 1 # failure was unexpected (normal test)
52+ echo "Build/Test failed as expected with force fail enabled"
53+ exit 0 # expected failure occurred
4554 fi
46- }
47-
48- # Run the command-line tests
49- ./scripts/cmd_test/do-cmd-tests.sh
55+ else
56+ # Normal case - expect success
57+ if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
58+ exit 1 # unexpected failure
59+ fi
60+ fi
5061
5162 - name : Print test logs
5263 if : always()
0 commit comments