CI: enable parallel tests (for x86_64, at least) (#2444)

TODO: enable parallel tests when using docker with no-x86_64 archs.

When I tried the obviuos solutions:
```
NDPI_FORCE_PARALLEL_UTESTS=1 NDPI_SKIP_PARALLEL_BAR=1 make check VERBOSE=1
```
I got:
```
Run configuration "caches_cfg" [--cfg=lru.ookla.size,0 --cfg=lru.msteams.ttl,1]
ookla.pcap	/bin/sh: 1: run_single_pcap: not found
teams.pcap	/bin/sh: 1: run_single_pcap: not found
Run configuration "caches_global" [--cfg=lru.ookla.scope,1 --cfg=lru.bittorrent.scope,1 --cfg=lru.stun.scope,1 --cfg=lru.tls_cert.scope,1 --cfg=lru.mining.scope,1 --cfg=lru.msteams.scope,1 --cfg=lru.stun_zoom.scope,1]
bittorrent.pcap	/bin/sh: 1: run_single_pcap: not found
lru_ipv6_caches.pcapng	/bin/sh: 1: run_single_pcap: not found
mining.pcapng	/bin/sh: 1: run_single_pcap: not found
...
```
This commit is contained in:
Ivan Nardi
2024-05-20 19:07:16 +02:00
committed by GitHub
parent 399be12585
commit bc8bc69beb
2 changed files with 17 additions and 8 deletions
+10 -1
View File
@@ -26,6 +26,11 @@ if [ "${NDPI_FORCE_PARALLEL_UTESTS}" = "1" ]; then
FORCE_PARALLEL_UTESTS=1
fi
SKIP_PARALLEL_BAR=0
if [ "${NDPI_SKIP_PARALLEL_BAR}" = "1" ]; then
SKIP_PARALLEL_BAR=1
fi
#Remember: valgrind and *SAN are incompatible!
CMD_PREFIX="${CMD_PREFIX}"
if [ "${NDPI_TESTS_WINE}" = "1" ]; then
@@ -188,7 +193,11 @@ export -f run_single_pcap
check_results() {
if [ $FORCE_PARALLEL_UTESTS -eq 1 ]; then
parallel --bar --tag "run_single_pcap" ::: $PCAPS
if [ $SKIP_PARALLEL_BAR -eq 1 ]; then
parallel --tag "run_single_pcap" ::: $PCAPS
else
parallel --bar --tag "run_single_pcap" ::: $PCAPS
fi
RET=$? #Number of failed job up to 100
RC=$(( RC + $RET ))
else