Skip to content

Commit

Permalink
fail tests in GH Actions but keep uploading the code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbsog0 committed Feb 17, 2023
1 parent 6096e20 commit b2af7c4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run pytest tests
run: mkdir build && cd build && cmake .. -DXCP_ENABLE_TEST=ON && make all && LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/project/build" ctest -V;gcov _cffi_xcp.c
run: ./test.sh
- name: Upload code coverage to Codecov
if: success() || failure()
uses: codecov/codecov-action@v1
with:
files: ./build/Xcp.c.gcov
11 changes: 11 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

result=0
mkdir -p build
cd build
cmake .. -DXCP_ENABLE_TEST=ON
make all
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/project/build" ctest -V
result=$?
gcov _cffi_xcp.c
exit $result
4 changes: 2 additions & 2 deletions test/asam_error_matrix_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,9 @@ def test_build_checksum_err_out_of_range(self):
handle.lib.Xcp_MainFunction()
assert tuple(handle.can_if_transmit.call_args[0][1].SduDataPtr[0:2]) == (0xFE, 0x22)

@pytest.mark.skip(reason='the memory mapping must be known in order to check if the provided address is correct...')
# @pytest.mark.skip(reason='the memory mapping must be known in order to check if the provided address is correct...')
def test_build_checksum_err_access_denied(self):
pass
pytest.fail('intentionally failing test for CI test')

@pytest.mark.skip(reason='XCP protocol layer specification 1.0 - 1.6.1.1.3: standard commands are never protected')
def test_build_checksum_err_access_locked(self):
Expand Down

0 comments on commit b2af7c4

Please sign in to comment.