Skip to content

Commit 45133ba

Browse files
committed
test force fail and normal build
1 parent b7bbe97 commit 45133ba

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

.github/workflows/simple.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,37 @@ jobs:
3333
- uses: actions/checkout@v4
3434
name: Checkout repository
3535

36-
- name: Run build and tests
36+
- name: Run normal build and tests
37+
if: ${{ !matrix.force_fail }}
3738
run: |
38-
# Build first with matrix config
39-
${{ matrix.config }} ${{ matrix.force_fail }} ./scripts/build-wolfprovider.sh || BUILD_RESULT=$?
39+
# Build with matrix config
40+
${{ matrix.config }} ./scripts/build-wolfprovider.sh; BUILD_RESULT=$?
4041
41-
# Run all tests
42-
./scripts/cmd_test/do-cmd-tests.sh || TEST_RESULT=$?
42+
# Run normal tests
43+
./scripts/cmd_test/do-cmd-tests.sh; TEST_RESULT=$?
4344
44-
# Run all tests with force fail
45-
WOLFPROV_FORCE_FAIL=1 ./scripts/cmd_test/do-cmd-tests.sh || TEST_RESULT=$?
45+
# Check normal test results
46+
if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
47+
echo "Normal build/test failed unexpectedly"
48+
exit 1
49+
fi
50+
51+
- name: Run force-fail build and tests
52+
if: ${{ matrix.force_fail }}
53+
run: |
54+
# Build with matrix config and force fail
55+
${{ matrix.config }} WOLFPROV_FORCE_FAIL=1 ./scripts/build-wolfprovider.sh; BUILD_RESULT=$?
56+
57+
# Run tests with force fail
58+
WOLFPROV_FORCE_FAIL=1 ./scripts/cmd_test/do-cmd-tests.sh; TEST_RESULT=$?
4659
47-
# For force_fail, we expect failures (return 1)
48-
if [ -n "${{ matrix.force_fail }}" ]; then
49-
if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
50-
echo "Build/Test unexpectedly succeeded with force fail enabled"
51-
exit 1 # failure was not seen when expected
52-
else
53-
echo "Build/Test failed as expected with force fail enabled"
54-
exit 0 # expected failure occurred
55-
fi
60+
# Check force-fail results - we expect failures
61+
if [ $BUILD_RESULT -eq 0 ] || [ $TEST_RESULT -eq 0 ]; then
62+
echo "Force-fail build/test unexpectedly succeeded"
63+
exit 1
5664
else
57-
# Normal case - expect success
58-
if [ $BUILD_RESULT -ne 0 ] || [ $TEST_RESULT -ne 0 ]; then
59-
exit 1 # unexpected failure
60-
fi
65+
echo "Force-fail build/test failed as expected"
66+
exit 0
6167
fi
6268
6369
- name: Print test logs

0 commit comments

Comments
 (0)