Skip to content

Commit 2734c70

Browse files
committed
chore: warning when enabling progress-bar when running in parallel
1 parent db90663 commit 2734c70

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

docs/command-line.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ Duration: 48 ms
346346
347347
Enable the progress bar during test execution. By default, the progress bar is disabled.
348348

349+
::: warning
350+
The progress bar cannot be used when running tests in parallel. If `--progress-bar` is combined with `--parallel`, a warning is printed and the bar is disabled.
351+
:::
352+
349353
::: code-group
350354
```bash [Example]
351355
./bashunit --progress-bar

docs/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ BASHUNIT_VERBOSE=true
253253
254254
Controls whether the progress bar is rendered. `false` by default.
255255

256+
::: warning
257+
The progress bar is disabled when tests run in parallel. Enabling `BASHUNIT_PROGRESS_BAR` while `BASHUNIT_PARALLEL_RUN` is `true` will print a warning and no bar will be shown.
258+
:::
259+
256260
::: code-group
257261
```bash [Example]
258262
BASHUNIT_PROGRESS_BAR=true

src/progress.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ function progress::init() {
99
# Track the last rendered progress state so the bar can be redrawn
1010
export PROGRESS_CURRENT=0
1111

12+
if env::is_progress_bar_enabled && parallel::is_enabled; then
13+
printf "%sWarning: Progress bar is not supported in parallel mode.%s\n" "${_COLOR_INCOMPLETE}" "${_COLOR_DEFAULT}"
14+
fi
15+
1216
if progress::enabled ; then
1317
progress::render 0 "$PROGRESS_TOTAL"
1418
fi

0 commit comments

Comments
 (0)