Skip to content

Commit

Permalink
bug 895771 - merge setup-test and coverage built targets into test
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnen committed Jul 22, 2013
1 parent 84f7921 commit eb76117
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -17,6 +17,7 @@ stackwalk/
exploitable/
docs/_build/
*~
coverage.xml
.coverage
cover/
.vagrant
Expand Down
25 changes: 15 additions & 10 deletions Makefile
Expand Up @@ -18,18 +18,24 @@ JENKINS_CONF = jenkins.py.dist

all: test

setup-test: bootstrap-dev
test: test-socorro test-webapp

test-socorro: bootstrap-dev
# jenkins only settings for the pre-configman components
# can be removed when all tests are updated to use configman
if [ $(WORKSPACE) ]; then cd socorro/unittest/config; cp $(JENKINS_CONF) commonconfig.py; fi;

# setup any unset test configs and databases without overwriting existing files
cd config; for file in *.ini-dist; do if [ ! -f `basename $$file -dist` ]; then cp $$file `basename $$file -dist`; fi; done
PYTHONPATH=$(PYTHONPATH) $(SETUPDB) --database_name=socorro_integration_test --database_username=$(DB_USER) --database_hostname=$(DB_HOST) --database_password=$(DB_PASSWORD) --database_port=$(DB_PORT) --database_superusername=$(DB_SUPERUSER) --database_superuserpassword=$(DB_SUPERPASSWORD) --dropdb
PYTHONPATH=$(PYTHONPATH) $(SETUPDB) --database_name=socorro_test --database_username=$(DB_USER) --database_hostname=$(DB_HOST) --database_password=$(DB_PASSWORD) --database_port=$(DB_PORT) --database_superusername=$(DB_SUPERUSER) --database_superuserpassword=$(DB_SUPERPASSWORD) --dropdb --no_schema
cd socorro/unittest/config; for file in *.py.dist; do if [ ! -f `basename $$file .dist` ]; then cp $$file `basename $$file .dist`; fi; done
# run tests with coverage
rm -f coverage.xml
PYTHONPATH=$(PYTHONPATH) DB_HOST=$(DB_HOST) $(COVERAGE) run $(NOSE)
$(COVERAGE) xml

test: setup-test
PYTHONPATH=$(PYTHONPATH) $(NOSE)
test-webapp: bootstrap-webapp
# run tests

bootstrap:
git submodule update --init --recursive
Expand All @@ -44,6 +50,11 @@ bootstrap-dev: bootstrap
# install dev + prod dependencies
$(VIRTUALENV)/bin/pip install --use-mirrors --download-cache=./pip-cache -r requirements/dev.txt

bootstrap-webapp: bootstrap
$(VIRTUALENV)/bin/pip install -q -r webapp-django/requirements/dev.txt
$(VIRTUALENV)/bin/pip install --install-option="--home=`pwd`/webapp-django/vendor-local" -r webapp-django/requirements/prod.txt
$(VIRTUALENV)/bin/pip install --install-option="--home=`pwd`/webapp-django/vendor-local" -r webapp-django/requirements/compiled.txt

install: bootstrap-prod reinstall

# this a dev-only option, `make install` needs to be run at least once in the checkout (or after `make clean`)
Expand Down Expand Up @@ -73,12 +84,6 @@ install-socorro: webapp-django
# copy default config files
cd $(PREFIX)/application/scripts/config; for file in *.py.dist; do cp $$file `basename $$file .dist`; done


coverage: setup-test
rm -f coverage.xml
PYTHONPATH=$(PYTHONPATH) DB_HOST=$(DB_HOST) $(COVERAGE) run $(NOSE)
$(COVERAGE) xml

lint:
rm -f pylint.txt
$(PYLINT) -f parseable --rcfile=pylintrc socorro > pylint.txt
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.sh
Expand Up @@ -48,7 +48,7 @@ export RABBITMQ_VHOST="socorro-jenkins"
export PATH=/usr/pgsql-9.2/bin:$PATH
echo "My path is $PATH"
# run unit tests
make coverage DB_USER=test DB_HOST=$DB_HOST DB_PASSWORD=aPassword DB_SUPERUSER=test DB_SUPERPASSWORD=aPassword
make test DB_USER=test DB_HOST=$DB_HOST DB_PASSWORD=aPassword DB_SUPERUSER=test DB_SUPERPASSWORD=aPassword

# pull pre-built, known version of breakpad
make clean
Expand Down

0 comments on commit eb76117

Please sign in to comment.