@@ -91,33 +91,37 @@ jobs:
91
91
env :
92
92
DOCKER_BUILDKIT : 1
93
93
TEST_ENV : " true"
94
- run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml up -d --build
94
+ run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml up ${{ matrix.skip_pytests != 'true' && '' || '-d' }} --build
95
95
96
96
- name : Wait for stack
97
+ if : ${{ matrix.skip_pytests != 'true' }}
97
98
timeout-minutes : 20
98
99
run : |
99
100
while [ "$(curl -s -o /dev/null -L -w ''%{http_code}'' "http://localhost:9090/health")" != "200" ]; do
100
101
echo "=> Waiting for service to become available" && sleep 2s
101
102
done
102
103
103
104
- name : Run general functional tests
105
+ if : ${{ matrix.skip_pytests != 'true' }}
104
106
env :
105
107
ML_BACKEND : ${{ matrix.backend_dir_name }}
106
108
run : |
107
109
pytest tests/ -vvv --ignore-glob='**/logs/*' --ignore-glob='**/data/*' --cov=. --cov-report=xml:tests/${{ matrix.backend_dir_name }}_coverage.xml
108
110
109
111
- name : Run per-ml-backend tests
112
+ if : ${{ matrix.skip_pytests != 'true' }}
110
113
env :
111
114
ML_BACKEND : ${{ matrix.backend_dir_name }}
112
115
run : |
113
116
docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml exec -T ${{ matrix.backend_dir_name }} pytest -vvv --cov --cov-report=xml:/tmp/coverage.xml
114
117
115
118
- name : Copy per-ml-backend coverage.xml from the container
119
+ if : ${{ matrix.skip_pytests != 'true' }}
116
120
run : |
117
121
docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml cp ${{ matrix.backend_dir_name }}:/tmp/coverage.xml label_studio_ml/examples/${{ matrix.backend_dir_name }}/coverage.xml
118
122
119
123
- name : Pull the logs
120
- if : always()
124
+ if : always() && matrix.skip_pytests != 'true'
121
125
env :
122
126
DOCKER_BUILDKIT : 1
123
127
run : docker compose -f label_studio_ml/examples/${{ matrix.backend_dir_name }}/docker-compose.yml logs
@@ -132,6 +136,7 @@ jobs:
132
136
fail_ci_if_error : false
133
137
134
138
- name : " Upload ml-backend ${{ matrix.backend_dir_name }} coverage to Codecov"
139
+ if : ${{ matrix.backend_dir_name == 'the_simplest_backend' }}
135
140
136
141
with :
137
142
name : codecov-${{ matrix.backend_dir_name }}
@@ -201,19 +206,21 @@ jobs:
201
206
for (const backend of backends) {
202
207
const config = docker_build_config.find(e => e.backend_dir_name === backend)
203
208
let runs_on = "ubuntu-latest";
209
+ let skip_pytests = "false";
204
210
if (config) {
205
211
console.log(`Config for ${backend}:`);
206
212
console.log(config);
207
213
if ((config.bypass ?? []).includes("pytests")) {
208
214
console.log(`Skipping pytests for ${backend}`);
209
- continue ;
215
+ skip_pytests = "true" ;
210
216
}
211
217
runs_on = config.runs_on ?? "ubuntu-latest";
212
218
} else {
213
219
console.log(`Could not find config for ${backend}`);
214
220
}
215
- matrixInclude.push({"backend_dir_name": backend, "runs_on": runs_on});
221
+ matrixInclude.push({"backend_dir_name": backend, "runs_on": runs_on, "skip_pytests": skip_pytests });
216
222
}
223
+ console.log(`Matrix calculation result:`);
217
224
console.log(matrixInclude);
218
225
core.setOutput("matrix-include", matrixInclude);
219
226
0 commit comments