File tree Expand file tree Collapse file tree 2 files changed +29
-25
lines changed
Expand file tree Collapse file tree 2 files changed +29
-25
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ sudo chown cmsuser:cmsuser ./codecov
4+
5+ dropdb --host=testdb --username=postgres cmsdbfortesting
6+ createdb --host=testdb --username=postgres cmsdbfortesting
7+ cmsInitDB
8+
9+ pytest --cov . --cov-report xml:codecov/unittests.xml
10+ UNIT=$?
11+
12+ dropdb --host=testdb --username=postgres cmsdbfortesting
13+ createdb --host=testdb --username=postgres cmsdbfortesting
14+ cmsInitDB
15+
16+ cmsRunFunctionalTests -v --coverage codecov/functionaltests.xml
17+ FUNC=$?
18+
19+ # This check is needed because otherwise failing unit tests aren't reported in
20+ # the CI as long as the functional tests are passing. Ideally we should get rid
21+ # of `cmsRunFunctionalTests` and make those tests work with pytest so they can
22+ # be auto-discovered and run in a single command.
23+ if [ $UNIT -ne 0 ] || [ $FUNC -ne 0 ]
24+ then
25+ exit 1
26+ else
27+ exit 0
28+ fi
Original file line number Diff line number Diff line change @@ -19,28 +19,4 @@ services:
1919 privileged : true
2020 cgroup : host
2121 command : >
22- wait-for-it testdb:5432 -- sh -c "
23- dropdb --host=testdb --username=postgres cmsdbfortesting ;
24- createdb --host=testdb --username=postgres cmsdbfortesting ;
25- cmsInitDB ;
26- sudo chown cmsuser:cmsuser ./codecov ;
27- pytest --cov . --cov-report xml:codecov/unittests.xml ;
28- UNIT=$? ;
29- dropdb --host=testdb --username=postgres cmsdbfortesting ;
30- createdb --host=testdb --username=postgres cmsdbfortesting ;
31- cmsInitDB ;
32- cmsRunFunctionalTests -v --coverage codecov/functionaltests.xml ;
33- FUNC=$? ;
34-
35- echo "Results: $UNIT $FUNC" ;
36-
37- # This contraption is needed because otherwise failing unit tests aren't
38- # reported in the CI as long as the functional tests are passing. Ideally
39- # we should get rid of `cmsRunFunctionalTests` and make those tests work
40- # with pytest so they can be auto-discovered and run in a single command.
41- if [ $UNIT -ne 0 ] || [ $FUNC -ne 0 ]; then
42- exit 1
43- else
44- exit 0
45- fi
46- "
22+ wait-for-it testdb:5432 -- ./_cms-test-internal.sh
You can’t perform that action at this time.
0 commit comments