Skip to content

Commit e1be732

Browse files
committed
Coverage fix attempt
1 parent 952ad4b commit e1be732

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

docker/dev+mongo.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
mongod &
44
MONGOD_PID=$!
55

6-
unitd --control "*:8888" --no-daemon --log /dev/stdout
6+
exec unitd --control "*:8888" --no-daemon --log /dev/stdout

tests/bin/run-tests-docker.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,23 @@ clean_up() {
9797
set +e
9898

9999
log "INFO: Test return code = $TEST_RESULT_CODE"
100-
if [ "${TEST_RESULT_CODE}" != "0" ]; then
100+
if [ "${TEST_RESULT_CODE}" = "0" ]; then
101+
# Copy unit test coverage
102+
docker cp scitran-core-test-runner:/src/core/.coverage .coverage.unit-tests
103+
104+
# Gracefully stop API then copy integration test coverage
105+
# TODO added exec to dev+mongo.sh and tried (TERM|KILL|INT|QUIT) signals to no avail
106+
# Somehow api.web.start/save_coverage() (atexit) is NOT triggered
107+
# docker kill --signal=SIGTERM scitran-core-test-service
108+
# docker cp scitran-core-test-service:/src/core/.coverage.integration-tests ./
109+
110+
# TODO report/combine/htmlize coverage using a test container
111+
else
101112
log "INFO: Printing container logs..."
102113
docker logs scitran-core-test-service
103114
log "ERROR: Test return code = $TEST_RESULT_CODE. Container logs printed above."
104115
fi
105116

106-
# Copy coverage file to host for possible further reporting
107-
docker cp scitran-core-test-runner:/src/core/.coverage .coverage
108-
109117
# Spin down dependencies
110118
docker rm -f -v scitran-core-test-runner
111119
docker rm -f -v scitran-core-test-service

tests/bin/run-tests-ubuntu.sh

-7
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,6 @@ main() {
115115
abao ../../api.raml "--server=$SCITRAN_SITE_API_URL" "--hookfiles=../../../tests/integration_tests/abao/abao_test_hooks.js"
116116
cd $BASEDIR
117117
fi
118-
119-
if ${RUN_ALL}; then
120-
log "OVERALL COVERAGE:"
121-
coverage combine
122-
coverage report --show-missing
123-
coverage html
124-
fi
125118
}
126119

127120

0 commit comments

Comments
 (0)