File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,18 @@ main() {
6767
6868 local SCITRAN_CORE_DRONE_SECRET=" secret"
6969
70+ # Clean dev/test artifacts like pyc files and coverage reports
71+ # Run within container to avoid permission problems
72+ docker run --rm \
73+ --name core-test-cleanup \
74+ --volume $( pwd) :/src/core \
75+ scitran/core:testing \
76+ sh -c '
77+ find . -type d -name __pycache__ -exec rm -rf {}\;;
78+ find . -type f -name "*.pyc" -delete;
79+ rm -rf .coverage htmlcov;
80+ '
81+
7082 # Launch core + mongo
7183 docker run -d \
7284 --name core-test-service \
@@ -114,7 +126,6 @@ clean_up() {
114126 --volume $( pwd) :/src/core \
115127 scitran/core:testing \
116128 sh -c '
117- rm -rf .coverage htmlcov;
118129 coverage combine;
119130 coverage report --skip-covered --show-missing;
120131 coverage html;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Envvars (required for integration tests):
3333
3434
3535main () {
36+ export PYTHONDONTWRITEBYTECODE=1
3637 export RUN_ALL=true
3738 local RUN_LINT=false
3839 local RUN_UNIT=false
@@ -94,12 +95,12 @@ main() {
9495 if ${RUN_UNIT} ; then
9596 log " Running unit tests ..."
9697 rm -f .coverage
97- PYTHONDONTWRITEBYTECODE=1 py.test --cov=api --cov-report= tests/unit_tests/python $PYTEST_ARGS
98+ py.test --cov=api --cov-report= tests/unit_tests/python $PYTEST_ARGS
9899 fi
99100
100101 if ${RUN_INTEG} ; then
101102 log " Running integration tests ..."
102- PYTHONDONTWRITEBYTECODE=1 py.test tests/integration_tests/python $PYTEST_ARGS
103+ py.test tests/integration_tests/python $PYTEST_ARGS
103104 fi
104105}
105106
You can’t perform that action at this time.
0 commit comments