-
Notifications
You must be signed in to change notification settings - Fork 376
/
Copy pathdocker-compose.test.yml
41 lines (39 loc) · 1.31 KB
/
docker-compose.test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
version: "3.3"
services:
testdb:
image: postgres
environment:
POSTGRES_HOST_AUTH_METHOD: trust
testcms:
build: .
depends_on:
- "testdb"
environment:
CMS_CONFIG: /usr/local/etc/cms-testdb.conf
# Could be removed in the future, see:
# - https://github.com/pytest-dev/pytest/issues/7443
# - https://github.com/actions/runner/issues/241
PYTEST_ADDOPTS: --color=yes
volumes:
- "./codecov:/home/cmsuser/cms/codecov"
privileged: true
cgroup: host
command: >
wait-for-it testdb:5432 -- sh -c "
sudo mkdir /run/isolate ;
echo /sys/fs/cgroup | sudo tee /run/isolate/cgroup ;
isolate --print-cg-root ;
isolate-check-environment ;
isolate --cg --box-id 1 --init ;
ls /sys/fs/cgroup/box-1 ;
isolate --cg --box-id 1 --clean ;
dropdb --host=testdb --username=postgres cmsdbfortesting ;
createdb --host=testdb --username=postgres cmsdbfortesting ;
cmsInitDB ;
sudo chown cmsuser:cmsuser ./codecov ;
pytest --cov . --cov-report xml:codecov/unittests.xml ;
dropdb --host=testdb --username=postgres cmsdbfortesting ;
createdb --host=testdb --username=postgres cmsdbfortesting ;
cmsInitDB ;
cmsRunFunctionalTests -v --coverage codecov/functionaltests.xml ;
"