-
Notifications
You must be signed in to change notification settings - Fork 3
100 lines (85 loc) · 2.55 KB
/
test.yaml
File metadata and controls
100 lines (85 loc) · 2.55 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: ID Mapping Service test
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
jobs:
id_mapping_service_container_tests:
runs-on: ubuntu-latest
steps:
- name: Check out GitHub repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9.19"
- name: Install dependencies and set up test config
shell: bash
run: |
# set up python dependencies
pip install pytest requests
# set up deploy.cfg
cp -n deploy.cfg.example deploy.cfg
sed -i "s#^mongo-host.*#mongo-host=mongo#" deploy.cfg
sed -i "s#^mongo-db.*#mongo-db=idmapping#" deploy.cfg
- name: Run tests
shell: bash
run: |
sh container_test/run_tests.sh
id_mapping_service_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: '3.9.19'
mongo: 'mongodb-linux-x86_64-3.6.23'
wired_tiger: 'false'
- python: '3.9.19'
mongo: 'mongodb-linux-x86_64-ubuntu2204-7.0.4'
wired_tiger: 'true'
steps:
- name: Check out GitHub repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python}}
- name: Install dependencies and set up test config
shell: bash
run: |
# install python libraries
python -m pip install --upgrade pip
pip install pipenv
pipenv sync --system --dev
# set up mongo
cd ..
wget -q http://fastdl.mongodb.org/linux/${{matrix.mongo}}.tgz
tar xfz ${{matrix.mongo}}.tgz
export MONGOD=`pwd`/${{matrix.mongo}}/bin/mongod
cd -
# set up test config
cp -n test.cfg.example test.cfg
sed -i "s#^test.temp.dir =.*#test.temp.dir=temp_test_dir#" test.cfg
sed -i "s#^test.mongo.exe.*#test.mongo.exe=$MONGOD#" test.cfg
sed -i "s#^test.mongo.wired_tiger.*#test.mongo.wired_tiger=${{matrix.wired_tiger}}#" test.cfg
- name: Run tests
shell: bash
run: |
HOMEDIR=`pwd`
PYTHONPATH=$HOMEDIR/src:$PYTHONPATH
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true