File tree 5 files changed +17
-14
lines changed 5 files changed +17
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ FROM bash:${bashver}
4
4
5
5
# Install parallel and accept the citation notice (we aren't using this in a
6
6
# context where it make sense to cite GNU Parallel).
7
- RUN apk add --no-cache parallel && \
7
+ RUN apk add --no-cache parallel ncurses && \
8
8
mkdir -p ~/.parallel && touch ~/.parallel/will-cite
9
9
10
10
RUN ln -s /opt/bats/bin/bats /usr/sbin/bats
Original file line number Diff line number Diff line change @@ -572,7 +572,7 @@ There was an initial [call for maintainers][call-maintain] for the original Bats
572
572
573
573
## Copyright
574
574
575
- © 2017-2018 bats-core organization
575
+ © 2017-2020 bats-core organization
576
576
577
577
© 2011-2016 Sam Stephenson
578
578
Original file line number Diff line number Diff line change @@ -224,6 +224,14 @@ if [[ "${#arguments[@]}" -eq 0 ]]; then
224
224
abort ' Must specify at least one <test>'
225
225
fi
226
226
227
+
228
+ if [[ -n " $output " ]]; then
229
+ if [[ ! -w " ${output} " ]]; then
230
+ abort " Output path ${output} is not writeable"
231
+ fi
232
+ export BATS_REPORT_OUTPUT_PATH=" $output "
233
+ fi
234
+
227
235
filenames=()
228
236
for filename in " ${arguments[@]} " ; do
229
237
expand_path " $filename " ' filename'
@@ -248,13 +256,5 @@ done
248
256
# shellcheck source=lib/bats-core/validator.bash
249
257
source " $BATS_ROOT /lib/bats-core/validator.bash"
250
258
251
- if [[ -n " $output " ]]; then
252
- if [[ ! -w " ${output} " ]]; then
253
- printf " Error: output path %s is not writeable\n" " ${output} " >&2
254
- exit 1
255
- fi
256
- export BATS_REPORT_OUTPUT_PATH=" $output "
257
- fi
258
-
259
259
set -o pipefail execfail
260
260
exec bats-exec-suite " ${flags[@]} " " ${filenames[@]} " | bats_test_count_validator | " bats-format-${formatter} " " ${formatter_flags[@]} "
Original file line number Diff line number Diff line change @@ -16,3 +16,5 @@ done < <(
16
16
)
17
17
18
18
LC_ALL=C.UTF-8 shellcheck " ${targets[@]} "
19
+
20
+ exit $?
Original file line number Diff line number Diff line change @@ -51,10 +51,11 @@ setup() {
51
51
[[ " ${lines[$i]} " == " ok $i slow test $t " ]]
52
52
done
53
53
done
54
- # In theory it should take 3s, but let's give it bit of extra time instead.
55
- # also check that parallelization happens accross all files instead of
54
+ # In theory it should take 3s, but let's give it bit of extra time for load tolerance.
55
+ # (Since there is no limit to load, we cannot totally avoid erronous failures by limited tolerance.)
56
+ # Also check that parallelization happens accross all files instead of
56
57
# linearizing between files, which requires at least 12s
57
- [[ " $duration " -lt 12 ]]
58
+ [[ " $duration " -lt 12 ]] || (echo " If this fails on Travis, make sure the failure is repeatable and not due to heavy load. " ; false)
58
59
}
59
60
60
61
@test " setup_file is not over parallelized" {
@@ -68,4 +69,4 @@ setup() {
68
69
[[ $duration -ge 6 ]]
69
70
# parallelization should at least get rid of 1/4th the total runtime
70
71
[[ $duration -lt 9 ]]
71
- }
72
+ }
You can’t perform that action at this time.
0 commit comments