Skip to content

Commit c622075

Browse files
committed
docs: document parallel execution improvements and opt-out directive
Add CHANGELOG entries for: - 30-40% performance improvement in parallel mode - Test-level parallelism feature - Opt-out directive for files with shared state - Strict mode compatibility fixes Add documentation for the no-parallel-tests directive in command-line guide.
1 parent cd6d53d commit c622075

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
### Changed
66
- Lower minimum Bash version requirement from 3.2 to 3.0
7+
- Improved parallel test execution performance (30-40% faster on large test suites)
8+
- Test functions now run in parallel within each file when using `--parallel` flag
9+
- Better load balancing through internal test file reorganization
10+
- Optimized result aggregation eliminates subprocess overhead
711

812
### Added
913
- Add Claude Code configuration with custom skills, agents, and rules
@@ -21,6 +25,10 @@
2125
- Shows only the final test summary
2226
- Useful for CI/CD pipelines or log-restricted environments
2327
- Can also be set via `BASHUNIT_NO_PROGRESS=true` environment variable
28+
- Support for `# bashunit: no-parallel-tests` directive in test files
29+
- Allows test files to opt out of test-level parallelism
30+
- Useful for tests with shared state or race conditions
31+
- Add as the second line in test files (after shebang)
2432

2533
### Fixed
2634
- Data providers now work without the `function` keyword on test functions (Issue #586)
@@ -29,6 +37,10 @@
2937
- Fixes regex in `bashunit::helper::get_provider_data()` to make the `function` keyword optional
3038
- Self-test `tests/acceptance/install_test.sh` now passes when no network tools are available (Issue #582)
3139
- Tests skip gracefully with `BASHUNIT_NO_NETWORK=true` or in sandboxed environments
40+
- Parallel test execution now works correctly in strict mode environments (bash -e -o pipefail)
41+
- Fixed arithmetic operations in result aggregation to prevent exit code 1 when values are zero
42+
- Fixed spinner cleanup to handle already-terminated processes gracefully
43+
- Ensures proper exit codes in CI environments like GitHub Actions Windows runners
3244

3345
## [0.32.0](https://github.com/TypedDevs/bashunit/compare/0.31.0...0.32.0) - 2026-01-12
3446

docs/command-line.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,32 @@ The line number syntax finds the test function that contains the specified line.
188188
189189
Run tests in parallel or sequentially. Sequential is the default.
190190

191+
In parallel mode, both test files and individual test functions run concurrently
192+
for maximum performance.
193+
191194
::: warning
192195
Parallel mode is supported on **macOS**, **Ubuntu**, and **Windows**. On other
193196
systems (like Alpine Linux) the option is automatically disabled due to
194197
inconsistent results.
195198
:::
196199

200+
::: tip Opt-out of test-level parallelism
201+
If a test file has shared state or race conditions, you can disable test-level
202+
parallelism by adding this directive as the second line:
203+
204+
```bash
205+
#!/usr/bin/env bash
206+
# bashunit: no-parallel-tests
207+
208+
function test_with_shared_state() {
209+
# This test will not run in parallel with others in this file
210+
}
211+
```
212+
213+
The file will still run in parallel with other files, but tests within it will
214+
run sequentially.
215+
:::
216+
197217
### Output Style
198218

199219
> `bashunit test -s|--simple`

0 commit comments

Comments
 (0)