Line | |
---|
1 | #!/usr/bin/env bash |
---|
2 | set -euxo pipefail |
---|
3 | tracking_filename="ratchet-passing" |
---|
4 | |
---|
5 | # Start somewhere predictable. |
---|
6 | cd "$(dirname $0)" |
---|
7 | base=$(pwd) |
---|
8 | |
---|
9 | # Actually, though, trial outputs some things that are only gitignored in the project root. |
---|
10 | cd "../.." |
---|
11 | |
---|
12 | export SUBUNITREPORTER_OUTPUT_PATH="$base/results.subunit2" |
---|
13 | # Since the next two calls are expected to exit non-0, relax our guard. |
---|
14 | trial --reporter=subunitv2-file allmydata || true |
---|
15 | subunit2junitxml < "${SUBUNITREPORTER_OUTPUT_PATH}" > "$base/results.xml" || true |
---|
16 | |
---|
17 | # Okay, now we're clear. |
---|
18 | cd "$base" |
---|
19 | |
---|
20 | # Make sure ratchet.py itself is clean. |
---|
21 | python3 -m doctest ratchet.py |
---|
22 | |
---|
23 | # Now see about Tahoe-LAFS (also expected to fail) ... |
---|
24 | set +e |
---|
25 | python3 ratchet.py up results.xml "$tracking_filename" |
---|
26 | code=$? |
---|
27 | set -e |
---|
28 | |
---|
29 | # Emit a diff of the tracking file, to aid in the situation where changes are |
---|
30 | # not discovered until CI (where TERM might `dumb`). |
---|
31 | if [ $TERM = 'dumb' ]; then |
---|
32 | export TERM=ansi |
---|
33 | fi |
---|
34 | |
---|
35 | echo "The ${tracking_filename} diff is:" |
---|
36 | echo "=================================" |
---|
37 | # "git diff" gets pretty confused in this execution context when trying to |
---|
38 | # write to stdout. Somehow it fails with SIGTTOU. |
---|
39 | git diff -- "${tracking_filename}" > tracking.diff |
---|
40 | cat tracking.diff |
---|
41 | echo "=================================" |
---|
42 | |
---|
43 | echo "Exiting with code ${code} from ratchet.py." |
---|
44 | exit ${code} |
---|
Note: See
TracBrowser
for help on using the repository browser.