Skip to content

Commit a07ec89

Browse files
authored
Add option for tolerable-failures file (#97)
1 parent 834760c commit a07ec89

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

run.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515

1616
display_usage() {
1717
cat << EOF
18-
Usage: ./run.sh [-d testdir] [-l] [-e <envfile>] <subject> [args]
18+
Usage: ./run.sh [-d testdir] [-l] [-e <envfile>] [-t <list>] <subject> [args]
1919
-d <testdir> Use local development version of tests in specified location
2020
-l Use local docker image of test harness (called testharness)
2121
-e <envfile> Use this env file instead of <subject>.env
22+
-t <file> Tolerate failures of the scenarios in this file
2223
<subject> The short name of the test subject
2324
[args] Other arguments passed to the test harness
2425
EOF
@@ -113,17 +114,18 @@ setup_config() {
113114
# if no arguments supplied, display usage
114115
if [ $# -lt 1 ]
115116
then
116-
display_usage
117-
exit 1
117+
display_usage
118+
exit 1
118119
fi
119120

120121
dockerimage='solidproject/conformance-test-harness'
121122
dockerargs=('-i' '--rm')
122123
cwd=$(pwd)
124+
harnessargs=('--output=/reports')
123125

124126
# parse options
125127
# the 'target' directory is used by Karate for it's own format reports which can be helpful in development
126-
while getopts "lhd:e:" arg; do
128+
while getopts "lhd:e:t:" arg; do
127129
case $arg in
128130
d)
129131
testDir="$(cd "${OPTARG}" && pwd)"
@@ -139,6 +141,10 @@ while getopts "lhd:e:" arg; do
139141
e)
140142
envfile="${OPTARG}"
141143
;;
144+
t)
145+
dockerargs+=('-v' "$cwd/${OPTARG}:/app/target/tolerable-failures.txt")
146+
harnessargs+=('--tolerable-failures=/app/target/tolerable-failures.txt')
147+
;;
142148
*)
143149
;;
144150
esac
@@ -149,8 +155,8 @@ shift $((OPTIND-1))
149155
# check there is at least a subject argument
150156
if [ $# -lt 1 ]
151157
then
152-
display_usage
153-
exit 1
158+
display_usage
159+
exit 1
154160
fi
155161

156162
# extract subject
@@ -165,7 +171,6 @@ shift
165171
echo "Running tests on $subject and reporting to $cwd/reports/$subject"
166172

167173
dockerargs+=('-v' "$cwd/reports/$outdir:/reports" "--env-file=$envfile")
168-
harnessargs=('--output=/reports')
169174
if ! [[ "$*" == *"--target="* ]]; then
170175
harnessargs+=("--target=https://github.com/solid/conformance-test-harness/$subject")
171176
fi
@@ -176,7 +181,7 @@ mkdir -p reports/$subject
176181
# optionally start CSS
177182
if [ $subject == "css" ]
178183
then
179-
setup_css
184+
setup_css
180185
dockerargs+=('--network=testnet')
181186
fi
182187

@@ -194,7 +199,7 @@ echo "Exit code: $exit_code"
194199
# optionally stop CSS
195200
if [ $subject == "css" ]
196201
then
197-
stop_css
202+
stop_css
198203
fi
199204

200205
exit "$exit_code"

0 commit comments

Comments
 (0)