summaryrefslogtreecommitdiff
path: root/tests/gold
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-07-15 09:39:31 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-07-15 09:39:31 -0400
commitc0da97eb03d4ffe8be8854ad6ff1a2736f169003 (patch)
tree971b019f78a5f1f2118dd5d46b5edb7937661a1f /tests/gold
parent4d05ddeeded7f3f594c0614630f467e1bf3fa629 (diff)
downloadpython-coveragepy-git-c0da97eb03d4ffe8be8854ad6ff1a2736f169003.tar.gz
test: change how we keep mismatched actual output
Now when a goldtest has a failure, the actual mismatched output will be written to the tests/actual directory. Along the way, I removed some obsolete settings which were only used by unittest and unittest_mixins, which we no longer use: - COVERAGE_KEEP_TMP - COVERAGE_ENV_ID - $TMPDIR/coverage_test
Diffstat (limited to 'tests/gold')
-rw-r--r--tests/gold/README.rst13
-rw-r--r--tests/gold/html/Makefile1
2 files changed, 6 insertions, 8 deletions
diff --git a/tests/gold/README.rst b/tests/gold/README.rst
index aec00c71..aec1d637 100644
--- a/tests/gold/README.rst
+++ b/tests/gold/README.rst
@@ -7,16 +7,13 @@ Gold files
These are files used in comparisons for some of the tests. Code to support
these comparisons is in tests/goldtest.py.
-If gold tests are failing, it can useful to set the COVERAGE_KEEP_TMP
-environment variable. If set, the test working directories at
-$TMPDIR/coverage_test are kept after the tests are run, so that you can
-manually inspect the differences.
+If gold tests are failing, you may need to update the gold files by copying the
+current output of the tests into the gold files. When a test fails, the actual
+output is in the tests/actual directory. Do not commit those files to git.
-Do this to clean the output directories and run only the failed tests while
-keeping the output::
+You can run just the failed tests again with::
- rm -rf $TMPDIR/coverage_test
- COVERAGE_KEEP_TMP=1 tox -e py37 -- --lf
+ tox -e py39 -- -n 0 --lf
The saved HTML files in the html directories can't be viewed properly without
the supporting CSS and Javascript files. But we don't want to save copies of
diff --git a/tests/gold/html/Makefile b/tests/gold/html/Makefile
index 604ece7a..c10ede3f 100644
--- a/tests/gold/html/Makefile
+++ b/tests/gold/html/Makefile
@@ -18,6 +18,7 @@ clean: ## Remove the effects of this Makefile.
git clean -fq .
update-gold: ## Copy output files from latest tests to gold files.
+ echo Note: this doesn't work now, it has to be updated for tests/actual
@for sub in $$TMPDIR/coverage_test/*HtmlGoldTests*/out; do \
rsync --verbose --existing --recursive $$sub/ . ; \
done ; \