Skip to content

Commit c9d2a35

Browse files
authored
Improve CI stability (#2079)
1 parent 95adc66 commit c9d2a35

2 files changed

Lines changed: 28 additions & 14 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
env:
1111
BUILD_DIR: Dist
12-
GCOVR_FLAGS: --gcov-ignore-parse-errors --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml
12+
GCOVR_FLAGS: --gcov-ignore-errors all --gcov-ignore-parse-errors all --merge-mode-functions=separate --exclude-throw-branches --filter Common --filter Pcap --filter Packet --xml
1313
CCACHE_DIR: ${{ github.workspace }}/.ccache
1414
CPPCHECK_VERSION: 2.9
1515

@@ -57,6 +57,7 @@ jobs:
5757
runs-on: ${{ matrix.runner }}
5858
container: seladb/${{ matrix.image }}
5959
strategy:
60+
fail-fast: false
6061
matrix:
6162
include: # Check the images at https://github.com/seladb/PcapPlusPlus-DockerImages
6263
- runner: ubuntu-latest
@@ -73,12 +74,15 @@ jobs:
7374
- runner: ubuntu-latest
7475
image: ubuntu2004
7576
config-zstd: OFF
77+
gcovr-version: 8.2
7678
- runner: ubuntu-latest
7779
image: rhel94
7880
config-zstd: OFF
81+
gcovr-version: 8.5
7982
- runner: ubuntu-latest
8083
image: ubuntu2004-zstd
8184
config-zstd: ON
85+
gcovr-version: 8.2
8286
- runner: ubuntu-latest
8387
image: fedora42
8488
config-zstd: OFF
@@ -157,7 +161,7 @@ jobs:
157161
- name: Create Cobertura Report
158162
run: |
159163
. .venv/bin/activate
160-
python3 -m pip install gcovr==8.2
164+
python3 -m pip install gcovr==${{ matrix.gcovr-version || '8.6' }}
161165
gcovr -v -r . ${{ matrix.additional-gcov-flags }} $GCOVR_FLAGS -o coverage.xml
162166
163167
- name: Upload Coverage Results
@@ -227,7 +231,7 @@ jobs:
227231
- name: Create Cobertura Report
228232
run: |
229233
. .venv/bin/activate
230-
python3 -m pip install gcovr==8.2
234+
python3 -m pip install gcovr==8.6
231235
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
232236
233237
- name: Upload Coverage Results
@@ -530,7 +534,7 @@ jobs:
530534
- name: Create Cobertura Report
531535
if: ${{ matrix.host-arch == matrix.arch }}
532536
run: |
533-
python3 -m pip install gcovr==8.2
537+
python3 -m pip install gcovr==8.6
534538
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
535539
536540
- name: Upload Coverage Results
@@ -651,7 +655,7 @@ jobs:
651655
python -m pytest --root-path=../../Dist/examples_bin
652656
653657
- name: Install Coverage Requirements
654-
run: python3 -m pip install gcovr==8.2
658+
run: python3 -m pip install gcovr==8.6
655659

656660
- name: Process Coverage Files
657661
shell: msys2 {0}
@@ -972,7 +976,7 @@ jobs:
972976
973977
- name: Create Cobertura Report
974978
run: |
975-
python -m pip install gcovr==8.2
979+
python -m pip install gcovr==8.6
976980
gcovr -v -r . $GCOVR_FLAGS -o coverage.xml
977981
978982
- name: Upload Coverage Results

ci/run_tests/run_tests.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@
1212

1313

1414
@contextmanager
15-
def tcp_replay_worker(interface: str, tcpreplay_dir: str):
16-
tcpreplay_proc = subprocess.Popen(
17-
["tcpreplay", "-i", interface, "--mbps=10", "-l", "0", PCAP_FILE_PATH],
18-
cwd=tcpreplay_dir,
19-
)
15+
def tcp_replay_worker(interface: str, tcpreplay_dir: str, use_sudo: bool):
16+
cmd_line = ["sudo"] * use_sudo + [
17+
"tcpreplay",
18+
"-i",
19+
interface,
20+
"--mbps=10",
21+
"-l",
22+
"0",
23+
PCAP_FILE_PATH,
24+
]
25+
tcpreplay_proc = subprocess.Popen(cmd_line, cwd=tcpreplay_dir)
2026
try:
2127
yield tcpreplay_proc
2228
finally:
@@ -51,10 +57,14 @@ def run_pcap_tests(self, interface: str, tcpreplay_dir: str, args: list[str]):
5157
exe_path = self.build_dir / self.pcap_test_path
5258
work_dir = exe_path.parent
5359

54-
cmd_line = ["sudo"] if self.use_sudo else []
55-
cmd_line += [str(exe_path.absolute()), "-i", ip_address, *args]
60+
cmd_line = ["sudo"] * self.use_sudo + [
61+
str(exe_path.absolute()),
62+
"-i",
63+
ip_address,
64+
*args,
65+
]
5666

57-
with tcp_replay_worker(interface, tcpreplay_dir):
67+
with tcp_replay_worker(interface, tcpreplay_dir, self.use_sudo):
5868
completed_process = subprocess.run(cmd_line, cwd=str(work_dir))
5969
if completed_process.returncode != 0:
6070
raise RuntimeError(

0 commit comments

Comments
 (0)