1515
1616display_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
2425EOF
@@ -113,17 +114,18 @@ setup_config() {
113114# if no arguments supplied, display usage
114115if [ $# -lt 1 ]
115116then
116- display_usage
117- exit 1
117+ display_usage
118+ exit 1
118119fi
119120
120121dockerimage=' solidproject/conformance-test-harness'
121122dockerargs=(' -i' ' --rm' )
122123cwd=$( 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
150156if [ $# -lt 1 ]
151157then
152- display_usage
153- exit 1
158+ display_usage
159+ exit 1
154160fi
155161
156162# extract subject
@@ -165,7 +171,6 @@ shift
165171echo " Running tests on $subject and reporting to $cwd /reports/$subject "
166172
167173dockerargs+=(' -v' " $cwd /reports/$outdir :/reports" " --env-file=$envfile " )
168- harnessargs=(' --output=/reports' )
169174if ! [[ " $* " == * " --target=" * ]]; then
170175 harnessargs+=(" --target=https://github.com/solid/conformance-test-harness/$subject " )
171176fi
@@ -176,7 +181,7 @@ mkdir -p reports/$subject
176181# optionally start CSS
177182if [ $subject == " css" ]
178183then
179- setup_css
184+ setup_css
180185 dockerargs+=(' --network=testnet' )
181186fi
182187
@@ -194,7 +199,7 @@ echo "Exit code: $exit_code"
194199# optionally stop CSS
195200if [ $subject == " css" ]
196201then
197- stop_css
202+ stop_css
198203fi
199204
200205exit " $exit_code "
0 commit comments