-
Notifications
You must be signed in to change notification settings - Fork 67
/
run-tests.sh
executable file
·168 lines (139 loc) · 3.46 KB
/
run-tests.sh
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
161
162
163
164
165
166
167
168
#!/bin/bash
# Run the Snowplow Tracker test suite.
# Quit on failure
set -e
# Need to execute from this dir
cd $(dirname $0)
# pytest because it has a neat output
export PATH="~/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
function deploy {
# pyenv install 3.5.10
if [ ! -e ~/.pyenv/versions/tracker35 ]; then
pyenv virtualenv 3.5.10 tracker35
pyenv activate tracker35
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.6.15
if [ ! -e ~/.pyenv/versions/tracker36 ]; then
pyenv virtualenv 3.6.15 tracker36
pyenv activate tracker36
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.7.17
if [ ! -e ~/.pyenv/versions/tracker37 ]; then
pyenv virtualenv 3.7.17 tracker37
pyenv activate tracker37
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.8.20
if [ ! -e ~/.pyenv/versions/tracker38 ]; then
pyenv virtualenv 3.8.20 tracker38
pyenv activate tracker38
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.9.20
if [ ! -e ~/.pyenv/versions/tracker39 ]; then
pyenv virtualenv 3.9.20 tracker39
pyenv activate tracker39
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.10.15
if [ ! -e ~/.pyenv/versions/tracker310 ]; then
pyenv virtualenv 3.10.15 tracker310
pyenv activate tracker310
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.11.10
if [ ! -e ~/.pyenv/versions/tracker311 ]; then
pyenv virtualenv 3.11.10 tracker311
pyenv activate tracker311
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.12.7
if [ ! -e ~/.pyenv/versions/tracker312 ]; then
pyenv virtualenv 3.12.7 tracker312
pyenv activate tracker312
pip install .
pip install -r requirements-test.txt
source deactivate
fi
# pyenv install 3.13.0
if [ ! -e ~/.pyenv/versions/tracker313 ]; then
pyenv virtualenv 3.13.0 tracker313
pyenv activate tracker313
pip install .
pip install -r requirements-test.txt
source deactivate
fi
}
function run_tests {
pyenv activate tracker35
pytest
source deactivate
pyenv activate tracker36
pytest
source deactivate
pyenv activate tracker37
pytest
source deactivate
pyenv activate tracker38
pytest
source deactivate
pyenv activate tracker39
pytest
source deactivate
pyenv activate tracker310
pytest
source deactivate
pyenv activate tracker311
pytest
source deactivate
pyenv activate tracker312
pytest
source deactivate
pyenv activate tracker313
pytest
source deactivate
}
function refresh_deploy {
pyenv uninstall -f tracker35
pyenv uninstall -f tracker36
pyenv uninstall -f tracker37
pyenv uninstall -f tracker38
pyenv uninstall -f tracker39
pyenv uninstall -f tracker310
pyenv uninstall -f tracker311
pyenv uninstall -f tracker312
pyenv uninstall -f tracker313
}
case "$1" in
"deploy") echo "Deploying python environments. This can take few minutes"
deploy
;;
"test") echo "Running tests"
run_tests
;;
"refresh") echo "Refreshing python environments"
refresh_deploy
deploy
;;
*) echo "Unknown subcommand. Specify deploy or test"
exit 1
;;
esac