-
Notifications
You must be signed in to change notification settings - Fork 17
160 lines (138 loc) · 5.17 KB
/
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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: KBase Workspace tests
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
push:
# run workflow when merging to main or develop
branches:
- main
- master
- develop
# TODO find out what minio ver we're using in CI / appdev / prod and use that
# TODO split tests into mongo related & non mongo related. Run the former once.
jobs:
workspace_container_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies and set up test config
shell: bash
run: |
# set up python dependencies
pip install pytest requests
- name: Run tests
shell: bash
run: |
sh scripts/run_tests.sh
workspace_deluxe_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- java: '11'
mongo: 'mongodb-linux-x86_64-3.6.23'
minio: '2019-05-23T00-29-34Z'
wired_tiger: 'true'
# the current production setup
- java: '11'
mongo: 'mongodb-linux-x86_64-3.6.13'
minio: '2019-05-23T00-29-34Z'
wired_tiger: 'false'
steps:
- uses: actions/checkout@v3
- name: Set up java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{matrix.java}}
- name: Set up Python 3.7 # sample service is on 3.7, handle service is on sdkbase2.latest
uses: actions/setup-python@v3
with:
python-version: "3.7"
- name: Install dependencies and set up test config
shell: bash
run: |
export HOMEDIR=`pwd`
# set up python dependencies
cd python_dependencies
pip install pipenv
pipenv sync --system
cd ..
# move to parent dir of homedir to install binaries etc
cd ..
# TODO Remove after updating auth controller to fat jar
# set up jars
git clone https://github.com/kbase/jars
export JARSDIR=$(pwd)/jars/lib/jars/
# set up arango
export ARANGODB_VER=3.9.1
export ARANGODB_V=39
curl -O https://download.arangodb.com/arangodb$ARANGODB_V/Community/Linux/arangodb3-linux-$ARANGODB_VER.tar.gz
tar -xf arangodb3-linux-$ARANGODB_VER.tar.gz
export ARANGO_EXE=$(pwd)/arangodb3-linux-$ARANGODB_VER/bin/arangod
export ARANGO_JS=$(pwd)/arangodb3-linux-$ARANGODB_VER/usr/share/arangodb3/js/
# set up handle service
export HS_COMMIT=08e18379817e16db920501b66ba62b66598f506c
export LOG_COMMIT=b549c557e3c519e0a55eadf7863a93db25cd6806
git clone https://github.com/kbase/handle_service2.git
cd handle_service2/
git checkout $HS_COMMIT
sudo chmod -R 777 .
cd lib/
mkdir biokbase
cd biokbase/
wget https://raw.githubusercontent.com/kbase/sdkbase2/$LOG_COMMIT/log.py
cd ..
export HSDIR=`pwd`
cd ../..
# set up sample service
export SAMPLE_COMMIT=6813fb148e95db2b11db6eea04f4d1d45cbb7119
git clone https://github.com/kbase/sample_service.git
cd sample_service
git checkout $SAMPLE_COMMIT
cd lib
export SAMPLE_DIR=`pwd`
cd ../..
# set up blobstore
wget -q -O blobstore https://github.com/kbase/blobstore/releases/download/v0.1.2/blobstore_linux_amd64
chmod a+x blobstore
export BLOBEXE=$(pwd)/blobstore
# set up mongo
wget -q http://fastdl.mongodb.org/linux/${{matrix.mongo}}.tgz
tar xfz ${{matrix.mongo}}.tgz
export MONGOD=`pwd`/${{matrix.mongo}}/bin/mongod
# set up minio
export MINIO=$HOMEDIR/test_dependencies/minio/${{matrix.minio}}/minio
gunzip $MINIO.gz
chmod a+x $MINIO
# set up test config
cd $HOMEDIR
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.minio.exe.*#test.minio.exe=$MINIO#" test.cfg
sed -i "s#^test.mongo.useWiredTiger.*#test.mongo.useWiredTiger=${{matrix.wired_tiger}}#" test.cfg
sed -i "s#^test.jars.dir.*#test.jars.dir=$JARSDIR#" test.cfg
sed -i "s#^test.blobstore.exe.*#test.blobstore.exe=$BLOBEXE#" test.cfg
sed -i "s#^test.handleservice.dir.*#test.handleservice.dir=$HSDIR#" test.cfg
sed -i "s#^test.sampleservice.dir.*#test.sampleservice.dir=$SAMPLE_DIR#" test.cfg
sed -i "s#^test.arango.exe.*#test.arango.exe=$ARANGO_EXE#" test.cfg
sed -i "s#^test.arango.js.*#test.arango.js=$ARANGO_JS#" test.cfg
cat test.cfg
- name: Run tests
shell: bash
run: |
./gradlew testQuick
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true