diff --git a/.gitignore b/.gitignore index b33c1aab8..8191c173b 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ zope.interface-*.egg /.hypothesis/ /eliot.log /misc/python3/results.xml +/misc/python3/results.subunit2 # This is the plaintext of the private environment needed for some CircleCI # operations. It's never supposed to be checked in. diff --git a/misc/python3/depgraph.sh b/misc/python3/depgraph.sh index a1ef21142..d5ad33bf7 100755 --- a/misc/python3/depgraph.sh +++ b/misc/python3/depgraph.sh @@ -10,7 +10,7 @@ cd tahoe-depgraph # Generate the maybe-changed data. python "${TAHOE}"/misc/python3/tahoe-depgraph.py "${TAHOE}" -if git diff-index --quiet HEAD tahoe-deps.json tahoe-ported.json; then +if git diff-index --quiet HEAD; then echo "Declining to commit without any changes." exit 0 fi diff --git a/misc/python3/passing b/misc/python3/ratchet-passing similarity index 100% rename from misc/python3/passing rename to misc/python3/ratchet-passing diff --git a/misc/python3/ratchet.py b/misc/python3/ratchet.py index 136fdcf4c..cb672cf67 100755 --- a/misc/python3/ratchet.py +++ b/misc/python3/ratchet.py @@ -26,9 +26,6 @@ The exit codes are: 1 - changes observed, whether welcome or unwelcome 2 - invocation error -Be sure to call as `./ratchet.py` and not `python ratchet.py` if you want to -see our exit code instead of Python's. - If does not exist, you'll get a FileNotFoundError: >>> _test('up', None, None) # doctest: +ELLIPSIS @@ -231,6 +228,7 @@ def main(direction, junitxml_path, tracking_path): results = JUnitXMLFile(junitxml_path).parse() if tracking_path == '...': + # Shortcut to aid in debugging XML parsing issues. results.report() return diff --git a/misc/python3/ratchet.sh b/misc/python3/ratchet.sh index 00acd60c3..a6a2c53c3 100755 --- a/misc/python3/ratchet.sh +++ b/misc/python3/ratchet.sh @@ -1,10 +1,18 @@ #!/usr/bin/env bash -base="$(dirname $0)" -tracking="passing" +set -euxo pipefail +tracking_filename="ratchet-passing" -# trial outputs some things that are only git-ignored in the root, so don't cd quite yet ... +# Start somewhere predictable. +cd "$(dirname $0)" +base=$(pwd) + +# Actually, though, trial outputs some things that are only gitignored in the project root. +cd "../.." + +# Since both of the next calls are expected to exit non-0, relax our guard. set +e -trial --reporter subunitv2 allmydata | subunit2junitxml > "$base/results.xml" +SUBUNITREPORTER_OUTPUT_PATH="$base/results.subunit2" trial --reporter subunitv2-file allmydata +subunit2junitxml < "$base/results.subunit2" > "$base/results.xml" set -e # Okay, now we're clear. @@ -13,11 +21,9 @@ cd "$base" # Make sure ratchet.py itself is clean. python3 -m doctest ratchet.py -# Now see about Tahoe-LAFS ... +# Now see about Tahoe-LAFS (also expected to fail) ... set +e -# P.S. Don't invoke as `python ratchet.py ...` because then Python swallows the -# exit code. -./ratchet.py up results.xml "$tracking" +python3 ratchet.py up results.xml "$tracking_filename" code=$? set -e @@ -26,6 +32,6 @@ set -e if [ $TERM = 'dumb' ]; then export TERM=ansi fi -git diff "$tracking" +git diff "$tracking_filename" exit $code diff --git a/setup.py b/setup.py index 3a7d8ef8c..f22ca0f4c 100644 --- a/setup.py +++ b/setup.py @@ -142,6 +142,7 @@ tor_requires = [ i2p_requires = [ # txi2p has Python 3 support, but it's unreleased: https://github.com/str4d/txi2p/issues/10. + # URL lookups are in PEP-508 (via https://stackoverflow.com/a/54794506). # Also see the comment in tor_requires. "txi2p @ git+https://github.com/str4d/txi2p@0611b9a86172cb70d2f5e415a88eee9f230590b3#egg=txi2p", ]