Makefile: remove/disable most broken stuff

probably fixes ticket:2743
This commit is contained in:
Brian Warner 2016-03-17 22:23:39 -07:00
parent 141ff17b91
commit c3bf9534ec
1 changed files with 48 additions and 112 deletions

160
Makefile
View File

@ -1,17 +1,14 @@
# NOTE: this Makefile requires GNU make
default: build
default:
@echo "no default target"
PYTHON=python
export PYTHON
PYFLAKES=pyflakes
export PYFLAKES
# setup.py will extend sys.path to include our support/lib/... directory
# itself. It will also create it in the beginning of the 'develop' command.
TAHOE=$(PYTHON) bin/tahoe
SOURCES=src/allmydata src/buildtest static misc setup.py
APPNAME=allmydata-tahoe
@ -27,16 +24,9 @@ make-version:
src/allmydata/_version.py:
$(MAKE) make-version
# It is unnecessary to have this depend on build or src/allmydata/_version.py,
# since 'setup.py build' always updates the version.
.PHONY: build
build:
$(PYTHON) setup.py build
touch .built
# Build OS X pkg packages.
.PHONY: build-osx-pkg test-osx-pkg upload-osx-pkg
build-osx-pkg: build
build-osx-pkg:
misc/build_helpers/build-osx-pkg.sh $(APPNAME)
test-osx-pkg:
@ -50,82 +40,28 @@ upload-osx-pkg:
echo not uploading tahoe-lafs-osx-pkg because this is not trunk but is branch \"${BB_BRANCH}\" ; \
fi
# TESTING
# you can use 'make test TEST=allmydata.test.test_introducer' to run just
# test_introducer. TEST=allmydata.test.test_client.Basic.test_permute works
# too.
TEST=allmydata
# code coverage-based testing is disabled temporarily, as we switch to tox.
# This will eventually be added to a tox environment. The following comments
# and variable settings are retained as notes for that future effort.
# It is unnecessary to have this depend on build or src/allmydata/_version.py,
# since 'setup.py test' always updates the version and builds before testing.
.PHONY: test
test:
$(PYTHON) setup.py test $(TRIALARGS) -s $(TEST)
touch .built
.PHONY: check
check: test
.PHONY: quicktest
quicktest: make-version
$(TAHOE) debug trial $(TRIALARGS) $(TEST)
# "make tmpfstest" may be a faster way of running tests on Linux. It works best when you have
# at least 330 MiB of free physical memory (to run the whole test suite). Since it uses sudo
# to mount/unmount the tmpfs filesystem, it might prompt for your password.
.PHONY: tmpfstest
tmpfstest:
time make _tmpfstest 'TMPDIR=$(shell mktemp -d --tmpdir=.)'
.PHONY: _tmpfstest
_tmpfstest: make-version
sudo mount -t tmpfs -o size=400m tmpfs '$(TMPDIR)'
-$(TAHOE) debug trial --rterrors '--temp-directory=$(TMPDIR)/_trial_temp' $(TRIALARGS) $(TEST)
sudo umount '$(TMPDIR)'
rmdir '$(TMPDIR)'
# code coverage: install the "coverage" package from PyPI, do "make test-coverage" to
# do a unit test run with coverage-gathering enabled, then use "make coverage-output" to
# generate an HTML report. Also see "make .coverage.el" and misc/coding_tools/coverage.el
# for Emacs integration.
# This might need to be python-coverage on Debian-based distros.
COVERAGE=coverage
COVERAGEARGS=--branch --source=src/allmydata
# --include appeared in coverage-3.4
COVERAGE_OMIT=--include '$(CURDIR)/src/allmydata/*' --omit '$(CURDIR)/src/allmydata/test/*'
.PHONY: test-coverage
test-coverage: build
rm -f .coverage
$(TAHOE) '@$(COVERAGE)' run $(COVERAGEARGS) @tahoe debug trial $(TRIALARGS) $(TEST)
.PHONY: coverage-output
coverage-output:
rm -rf coverage-html
coverage html -i -d coverage-html $(COVERAGE_OMIT)
cp .coverage coverage-html/coverage.data
@echo "now point your browser at coverage-html/index.html"
.coverage.el: .coverage
$(PYTHON) misc/coding_tools/coverage2el.py
## # code coverage: install the "coverage" package from PyPI, do "make
## # test-coverage" to do a unit test run with coverage-gathering enabled, then
## # use "make coverage-output" to generate an HTML report. Also see "make
## # .coverage.el" and misc/coding_tools/coverage.el for Emacs integration.
##
## # This might need to be python-coverage on Debian-based distros.
## COVERAGE=coverage
##
## COVERAGEARGS=--branch --source=src/allmydata
##
## # --include appeared in coverage-3.4
## COVERAGE_OMIT=--include '$(CURDIR)/src/allmydata/*' --omit '$(CURDIR)/src/allmydata/test/*'
.PHONY: code-checks
code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes
.PHONY: version-and-path
version-and-path:
$(TAHOE) --version-and-path
.PHONY: check-interfaces
check-interfaces:
$(TAHOE) @misc/coding_tools/check-interfaces.py 2>&1 |tee violations.txt
@echo
#code-checks: build version-and-path check-interfaces check-miscaptures -find-trailing-spaces -check-umids pyflakes
code-checks: check-miscaptures -find-trailing-spaces -check-umids pyflakes
.PHONY: check-miscaptures
check-miscaptures:
@ -166,6 +102,21 @@ count-lines:
@echo -n "XXX: "
@grep XXX `find src -name '*.py' |grep -v /build/` | wc -l
# Here is a list of testing tools that can be run with 'python' from a
# virtualenv in which Tahoe has been installed. There used to be Makefile
# targets for each, but the exact path to a suitable python is now up to the
# developer. But as a hint, after running 'tox', ./.tox/py27/bin/python will
# probably work.
# src/allmydata/test/bench_dirnode.py
# misc/coding_tools/check-interfaces.py 2>&1 |tee violations.txt
# The check-speed and check-grid targets are disabled, since they depend upon
# the pre-located $(TAHOE) executable that was removed when we switched to
# tox. They will eventually be resurrected as dedicated tox environments.
# The check-speed target uses a pre-established client node to run a canned
# set of performance tests against a test network that is also
# pre-established (probably on a remote machine). Provide it with the path to
@ -177,38 +128,23 @@ count-lines:
# The 'sleep 5' is in there to give the new client a chance to connect to its
# storageservers, since check_speed.py has no good way of doing that itself.
.PHONY: check-speed
check-speed: .built
if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
@echo "stopping any leftover client code"
-$(TAHOE) stop $(TESTCLIENTDIR)
$(TAHOE) start $(TESTCLIENTDIR)
sleep 5
$(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)
$(TAHOE) stop $(TESTCLIENTDIR)
##.PHONY: check-speed
##check-speed: .built
## if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
## @echo "stopping any leftover client code"
## -$(TAHOE) stop $(TESTCLIENTDIR)
## $(TAHOE) start $(TESTCLIENTDIR)
## sleep 5
## $(TAHOE) @src/allmydata/test/check_speed.py $(TESTCLIENTDIR)
## $(TAHOE) stop $(TESTCLIENTDIR)
# The check-grid target also uses a pre-established client node, along with a
# long-term directory that contains some well-known files. See the docstring
# in src/allmydata/test/check_grid.py to see how to set this up.
.PHONY: check-grid
check-grid: .built
if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
$(TAHOE) @src/allmydata/test/check_grid.py $(TESTCLIENTDIR) bin/tahoe
.PHONY: bench-dirnode
bench-dirnode: .built
$(TAHOE) @src/allmydata/test/bench_dirnode.py
# the provisioning tool runs as a stand-alone webapp server
.PHONY: run-provisioning-tool
run-provisioning-tool: .built
$(TAHOE) @misc/operations_helpers/provisioning/run.py
# 'make repl' is a simple-to-type command to get a Python interpreter loop
# from which you can type 'import allmydata'
.PHONY: repl
repl:
$(TAHOE) debug repl
##.PHONY: check-grid
##check-grid: .built
## if [ -z '$(TESTCLIENTDIR)' ]; then exit 1; fi
## $(TAHOE) @src/allmydata/test/check_grid.py $(TESTCLIENTDIR) bin/tahoe
.PHONY: test-get-ignore
test-git-ignore: