Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Tinker with testing infra
Browse files Browse the repository at this point in the history
- Extricate test-schema from test so that we can manually do make run
  for ttw tests, otherwise it kills the db that the server is looking at
- Move basic py.test config out of ARGS (works fine to layer if need be
  by duping in ARGS)
- Move --cov over to .travis.yml (pass into ARGS if you want coverage
  locally)
- Cut down the noise at Travis
- Make sure we're testing/flaking ./deploy
  • Loading branch information
chadwhitacre committed Aug 31, 2017
1 parent ef53850 commit 90d3690
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ before_script:

- psql -U postgres -c 'CREATE DATABASE "gratipay";'
- if [ "${TRAVIS_BRANCH}" = "master" -a "${TRAVIS_PULL_REQUEST}" = "false" ]; then rm -rfv tests/py/fixtures; fi
script: LD_LIBRARY_PATH=/usr/local/lib xvfb-run make bgrun test doc
script: LD_LIBRARY_PATH=/usr/local/lib ARGS="--cov=gratipay" xvfb-run make test-schema bgrun test doc
notifications:
email: false
irc: false
32 changes: 16 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ test_env_files := defaults.env,tests/defaults.env,tests/local.env
pip := $(env_bin)/pip
honcho := $(env_bin)/honcho
honcho_run := $(honcho) run -e defaults.env,local.env
py_test := $(honcho) run -e $(test_env_files) $(env_bin)/py.test
py_test := $(honcho) run -e $(test_env_files) $(env_bin)/py.test --tb=native --capture=sys

ifdef ARGS
test_args = $(ARGS)
py_test_args = $(ARGS)
else
test_args = -vv --tb=native --cov gratipay ./tests/
py_test_args = tests deploy
endif


Expand All @@ -38,14 +38,14 @@ clean:

# Schema-related

test-schema: env
$(honcho) run -e $(test_env_files) ./recreate-schema.sh 2>&1 | tee make-test-schema.log
@echo 'P.S. Log is in make-test-schema.log'

schema: env
$(honcho_run) ./recreate-schema.sh 2>&1 | tee make-schema.log
@echo 'P.S. Log is in make-schema.log'

test-schema: env
$(honcho) run -e $(test_env_files) ./recreate-schema.sh 2>&1 | tee make-test-schema.log
@echo 'P.S. Log is in make-test-schema.log'

fake:
$(honcho_run) $(env_bin)/fake-data

Expand All @@ -64,26 +64,26 @@ stop:

# Testing and linting

test: test-schema
test:
@$(MAKE) --no-print-directory flake
$(py_test) $(test_args)
$(py_test) $(py_test_args)

retest: env
@$(MAKE) --no-print-directory flake
$(py_test) --lf $(test_args)
$(py_test) --lf $(py_test_args)

flake: env
$(env_bin)/pyflakes *.py bin gratipay tests
$(env_bin)/pyflakes *.py bin gratipay tests deploy


# Internationalization

transifexrc:
@echo '[https://www.transifex.com]' >.transifexrc
@echo 'hostname = https://www.transifex.com' >>.transifexrc
@echo "password = $$TRANSIFEX_PASS" >>.transifexrc
@echo 'token = ' >>.transifexrc
@echo "username = $$TRANSIFEX_USER" >>.transifexrc
@echo '[https://www.transifex.com]' > .transifexrc
@echo 'hostname = https://www.transifex.com' >> .transifexrc
@echo "password = $$TRANSIFEX_PASS" >> .transifexrc
@echo 'token = ' >> .transifexrc
@echo "username = $$TRANSIFEX_USER" >> .transifexrc

tx:
@if [ ! -x $(env_bin)/tx ]; then $(env_bin)/pip install transifex-client; fi
Expand Down

0 comments on commit 90d3690

Please sign in to comment.