Commit 6909f23
committed
feat(parallel): implement test-level parallelism for improved performance
Enable parallel execution of individual test functions within files,
not just parallel file execution. This significantly improves CPU
utilization and reduces test execution time.
Implementation:
- Modified call_test_functions to run test functions in parallel
- Added opt-out mechanism via `# bashunit: no-parallel-tests` marker
- Tests within a file now execute concurrently using background jobs
- Result aggregation already supports per-test result files
Opt-out marker added to tests with shared state:
- install_test.sh (shares ./lib and ./deps directories)
- bashunit_report_html_test.sh (shares HTML output files)
- bashunit_upgrade_test.sh (shares tmp/ directory)
Performance improvement:
- Parallel execution: 31.71s (down from ~40s, ~21% faster)
- CPU utilization: 702% (up from ~480%)
- Better parallelization across all available cores
All 750 tests passing, all 1136 assertions correct.1 parent 91e523b commit 6909f23
4 files changed
Lines changed: 24 additions & 2 deletions
File tree
- src
- tests/acceptance
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
345 | 351 | | |
346 | 352 | | |
347 | 353 | | |
| |||
363 | 369 | | |
364 | 370 | | |
365 | 371 | | |
366 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
367 | 377 | | |
368 | 378 | | |
369 | 379 | | |
| |||
379 | 389 | | |
380 | 390 | | |
381 | 391 | | |
382 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
383 | 397 | | |
384 | 398 | | |
385 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
386 | 405 | | |
387 | 406 | | |
388 | 407 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
0 commit comments