ntop / nDPI

Open Source Deep Packet Inspection Software Toolkit
http://www.ntop.org
GNU Lesser General Public License v3.0
3.86k stars 902 forks source link

Parallel execution of unit tests #2435

Closed IvanNardi closed 6 months ago

IvanNardi commented 6 months ago

Running unit tests is quite a bottleneck while developing or while waiting for GitHub CI results... Try to run the tests in parallel, using the parallel tool.

By default, tests still run one after the other, as usual; to enable parallel execution you need NDPI_FORCE_PARALLEL_UTESTS=1 ./tests/do.sh

Please note that the output is quite different in parallel mode!

A big part of the script has been rewritten to avoid code duplication between "serial" and "parallel" path

On my notebook:

ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(parallel)$ time ./tests/do.sh
[...]
real    3m12,684s
[...]
ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(parallel)$ time NDPI_FORCE_PARALLEL_UTESTS=1 ./tests/do.sh
[...]
real    0m58,463s
sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

IvanNardi commented 6 months ago

What features are not support by now?

Not more limitations, AFAIK!

utoni commented 6 months ago

Just out of curiosity: What features aren't supported by the current parallels approach?

IvanNardi commented 6 months ago

Just out of curiosity: What features aren't supported by the current parallels approach?

There shouldn't be any (with the last version). I updated the message commit