Skip to content

Commit b2ddec7

Browse files
authored
Merge pull request #627 from TypedDevs/fix/370-alpine-parallel-tests
fix(parallel): enable parallel test execution on Alpine Linux
2 parents f73af6d + 77d135b commit b2ddec7

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,19 @@ jobs:
168168
run: ./bashunit --parallel --jobs 4 ${{ matrix.test_path }}
169169

170170
alpine:
171-
name: "Alpine - latest"
171+
name: "Alpine - ${{ matrix.name }}"
172172
runs-on: ubuntu-latest
173173
timeout-minutes: 10
174+
strategy:
175+
fail-fast: false
176+
matrix:
177+
include:
178+
- name: "sequential"
179+
command: "make test"
180+
- name: "parallel simple"
181+
command: "./bashunit --parallel --simple tests/"
182+
- name: "parallel extended"
183+
command: "./bashunit --parallel tests/"
174184
steps:
175185
- name: Checkout
176186
uses: actions/checkout@v4
@@ -187,4 +197,4 @@ jobs:
187197
apk add --no-cache bash make git jq && \
188198
adduser -D builder && \
189199
chown -R builder /project && \
190-
su - builder -c 'cd /project; make test';"
200+
su - builder -c 'cd /project; ${{ matrix.command }}';"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Fix invalid `.env.example` coverage threshold entry and copy `.env.example` to `.env` in CI test workflows so configuration parse errors are caught during automated test runs
1313
- Fix `clock::now` shell-time parsing when `EPOCHREALTIME` uses a comma decimal separator
1414
- Fix LCOV and HTML coverage reports generating incomplete/empty output due to post-increment operator causing silent exit under `set -e` (#618)
15+
- Enable parallel test execution on Alpine Linux; previously gated off due to race conditions, now resolved (#370)
1516

1617
## [0.34.1](https://github.com/TypedDevs/bashunit/compare/0.34.0...0.34.1) - 2026-03-20
1718

src/parallel.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ function bashunit::parallel::is_enabled() {
135135
"requested:$BASHUNIT_PARALLEL_RUN" "os:${_BASHUNIT_OS:-Unknown}"
136136

137137
if bashunit::env::is_parallel_run_enabled &&
138-
(bashunit::check_os::is_macos || bashunit::check_os::is_ubuntu || bashunit::check_os::is_windows); then
138+
(bashunit::check_os::is_macos || bashunit::check_os::is_ubuntu ||
139+
bashunit::check_os::is_alpine || bashunit::check_os::is_windows); then
139140
return 0
140141
fi
141142
return 1

tests/unit/parallel_test.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ function test_parallel_enabled_on_ubuntu() {
7777
bashunit::mock bashunit::check_os::is_windows mock_false
7878
bashunit::mock bashunit::check_os::is_macos mock_false
7979
bashunit::mock bashunit::check_os::is_ubuntu mock_true
80+
bashunit::mock bashunit::check_os::is_alpine mock_false
81+
82+
assert_successful_code "$(bashunit::parallel::is_enabled)"
83+
}
84+
85+
function test_parallel_enabled_on_alpine() {
86+
bashunit::mock bashunit::check_os::is_windows mock_false
87+
bashunit::mock bashunit::check_os::is_macos mock_false
88+
bashunit::mock bashunit::check_os::is_ubuntu mock_false
89+
bashunit::mock bashunit::check_os::is_alpine mock_true
8090

8191
assert_successful_code "$(bashunit::parallel::is_enabled)"
8292
}
@@ -93,6 +103,7 @@ function test_parallel_disabled_on_unsupported_os() {
93103
bashunit::mock bashunit::check_os::is_windows mock_false
94104
bashunit::mock bashunit::check_os::is_macos mock_false
95105
bashunit::mock bashunit::check_os::is_ubuntu mock_false
106+
bashunit::mock bashunit::check_os::is_alpine mock_false
96107

97108
assert_general_error "$(bashunit::parallel::is_enabled)"
98109
}

0 commit comments

Comments
 (0)