Skip to content

test: cut repeated work from the project suite - #1460

Merged
Chemaclass merged 1 commit into
mainfrom
perf/faster-test-suite
Nov 7, 2026
Merged

Chemaclass merged 1 commit into
mainfrom
perf/faster-test-suite

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

Summary

The project suite repeated work without testing anything more. This removes the repeats and keeps every assertion.

  • Tests that ran bashunit a second time only to read the exit code now reuse the first run's code (about 40 runs).
  • bench_reports, list and output_stdout run their shared command once per file and the tests read the cached result.
  • summary_output used real test files as fixtures (bashunit_init_test.sh three times). It now uses a small fixture with one skipped and one incomplete test. This also removes the rule that bashunit_init_test.sh must keep exactly one skip.
  • total_tests_parity walked every repo test file three times, once per filter. It now walks once and checks all three cases.
  • json_skip_label built its no-jq PATH with about 970 ln calls per test. It now builds it once with one ln call.
  • The validation docs pointed at BASHUNIT_PARALLEL_JOBS=4 make test, but make test runs sequentially and that variable does not turn parallel on. They now use make test/parallel, which make help also lists.

Timing

Files run one at a time, before and after:

File Before After
bashunit_summary_output_test.sh 9.4s 0.8s
total_tests_parity_test.sh 6.2s 4.0s
bashunit_json_skip_label_test.sh 4.5s 1.7s
bashunit_bench_reports_test.sh 2.4s 1.0s
bashunit_output_stdout_test.sh 2.9s 2.2s

Full suite with --parallel --jobs 4: 69s before, 59s after. A sequential local run (what the old docs led to) took 5m46s.

Test plan

  • ./bashunit --parallel --jobs 4 tests: 2840 passed, same test count as main
  • ./bashunit --suite strict tests: green
  • make sa, make lint
  • npm run agents:check

Tests no longer rerun bashunit only to read its exit code, shared runs are
cached per file, the summary test uses a small fixture instead of real test
files, the parity check walks the repo once, and the no-jq PATH is built with
one ln call. Contributor docs point full runs at make test/parallel, since
make test is sequential.
@Chemaclass Chemaclass self-assigned this Nov 7, 2026
@Chemaclass Chemaclass added pure testing Pure testing related refactoring Refactoring or cleaning related labels Nov 7, 2026
@Chemaclass
Chemaclass merged commit 4f713af into main Nov 7, 2026
40 checks passed
@Chemaclass
Chemaclass deleted the perf/faster-test-suite branch November 7, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pure testing Pure testing related refactoring Refactoring or cleaning related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants