tahoe debug trial: print a warning message if testing uncommitted code. fixes #1992
Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
parent
6e10d637e1
commit
aa29f2655d
10
Makefile
10
Makefile
@ -15,7 +15,7 @@ SOURCES=src/allmydata src/buildtest static misc bin/tahoe-script.template twiste
|
|||||||
.PHONY: make-version build
|
.PHONY: make-version build
|
||||||
|
|
||||||
# This is necessary only if you want to automatically produce a new
|
# This is necessary only if you want to automatically produce a new
|
||||||
# _version.py file from the current git/darcs history.
|
# _version.py file from the current git/darcs history (without doing a build).
|
||||||
make-version:
|
make-version:
|
||||||
$(PYTHON) ./setup.py update_version
|
$(PYTHON) ./setup.py update_version
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ src/allmydata/_version.py:
|
|||||||
$(MAKE) make-version
|
$(MAKE) make-version
|
||||||
|
|
||||||
# It is unnecessary to have this depend on build or src/allmydata/_version.py,
|
# It is unnecessary to have this depend on build or src/allmydata/_version.py,
|
||||||
# since 'setup.py build' always updates the version using 'darcsver --count-all-patches'.
|
# since 'setup.py build' always updates the version.
|
||||||
build:
|
build:
|
||||||
$(PYTHON) setup.py build
|
$(PYTHON) setup.py build
|
||||||
touch .built
|
touch .built
|
||||||
@ -58,7 +58,7 @@ test-coverage: build
|
|||||||
rm -f .coverage
|
rm -f .coverage
|
||||||
$(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
|
$(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
|
||||||
|
|
||||||
quicktest:
|
quicktest: make-version
|
||||||
$(TAHOE) debug trial $(TRIALARGS) $(TEST)
|
$(TAHOE) debug trial $(TRIALARGS) $(TEST)
|
||||||
|
|
||||||
# "make tmpfstest" may be a faster way of running tests on Linux. It works best when you have
|
# "make tmpfstest" may be a faster way of running tests on Linux. It works best when you have
|
||||||
@ -67,7 +67,7 @@ quicktest:
|
|||||||
tmpfstest:
|
tmpfstest:
|
||||||
time make _tmpfstest 'TMPDIR=$(shell mktemp -d --tmpdir=.)'
|
time make _tmpfstest 'TMPDIR=$(shell mktemp -d --tmpdir=.)'
|
||||||
|
|
||||||
_tmpfstest:
|
_tmpfstest: make-version
|
||||||
sudo mount -t tmpfs -o size=400m tmpfs '$(TMPDIR)'
|
sudo mount -t tmpfs -o size=400m tmpfs '$(TMPDIR)'
|
||||||
-$(TAHOE) debug trial --rterrors '--temp-directory=$(TMPDIR)/_trial_temp' $(TRIALARGS) $(TEST)
|
-$(TAHOE) debug trial --rterrors '--temp-directory=$(TMPDIR)/_trial_temp' $(TRIALARGS) $(TEST)
|
||||||
sudo umount '$(TMPDIR)'
|
sudo umount '$(TMPDIR)'
|
||||||
@ -79,7 +79,7 @@ _tmpfstest:
|
|||||||
# coverage-output" for a pretty HTML report. Also see "make .coverage.el" and
|
# coverage-output" for a pretty HTML report. Also see "make .coverage.el" and
|
||||||
# misc/coding_tools/coverage.el for emacs integration.
|
# misc/coding_tools/coverage.el for emacs integration.
|
||||||
|
|
||||||
quicktest-coverage:
|
quicktest-coverage: make-version
|
||||||
rm -f .coverage
|
rm -f .coverage
|
||||||
PYTHONPATH=. $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
|
PYTHONPATH=. $(TAHOE) debug trial --reporter=bwverbose-coverage $(TEST)
|
||||||
# on my laptop, "quicktest" takes 239s, "quicktest-coverage" takes 304s
|
# on my laptop, "quicktest" takes 239s, "quicktest-coverage" takes 304s
|
||||||
|
@ -996,6 +996,14 @@ Tahoe-LAFS. The default test suite is '%s'.
|
|||||||
def trial(config):
|
def trial(config):
|
||||||
sys.argv = ['trial'] + config.trial_args
|
sys.argv = ['trial'] + config.trial_args
|
||||||
|
|
||||||
|
from allmydata._version import full_version
|
||||||
|
if full_version.endswith("-dirty"):
|
||||||
|
print >>sys.stderr
|
||||||
|
print >>sys.stderr, "WARNING: the source tree has been modified since the last commit."
|
||||||
|
print >>sys.stderr, "(It is usually preferable to commit, then test, then amend the commit(s)"
|
||||||
|
print >>sys.stderr, "if the tests fail.)"
|
||||||
|
print >>sys.stderr
|
||||||
|
|
||||||
# This does not return.
|
# This does not return.
|
||||||
twisted_trial.run()
|
twisted_trial.run()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user