Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[testing] add skipUnlessHasBinaries decorator
Some tests are currently allowed to fail with @mayFail because some binaries may be missing. The problem is that we cannot differenciate between a test failing because some tooling is missing, or tests legitimately failing. This diff creates a new decorator that will skip a test if some binaries are not present, therefore, if the binaries are there and there is any issue, CI will fail. It will generate a message similar to: ``` docker run -ti \ --privileged \ --network=host \ --pid=host \ -v $(pwd):/bcc \ -v /sys/kernel/debug:/sys/kernel/debug:rw \ -v /lib/modules:/lib/modules:ro \ -v /usr/src:/usr/src:ro \ -e CTEST_OUTPUT_ON_FAILURE=1 \ u34 \ /bin/bash -c \ '/bcc/build/tests/wrapper.sh "py_test_percpu" "sudo" "/bcc/tests/python/test_brb.py" test_brb.c -v' test_brb (__main__.TestBPFSocket) ... skipped 'Missing binaries: neperf, neterver. iperf and netperf packages must be installed.' ---------------------------------------------------------------------- Ran 1 test in 0.000s OK (skipped=1) ```
- Loading branch information