77# To avoid collision with other GCP connections we create specific vars for
88# the ETE Test Pipeline.
99# ETE_GOOGLE_PROJECT_ID - GCP Project ID for ecosystem-test-eng
10- # ETE_GCLOUD_SERVICE_KEY - GCP syncstorage specific Service Account JSON Key
10+ # ETE_GCLOUD_SERVICE_KEY - GCP syncstorage specific Service Account JSON Key
1111# ETE_GOOGLE_PROJECT_NUMBER - GCP Project Number for ecosystem-test-eng
1212#
1313version : 2.1
@@ -63,20 +63,17 @@ commands:
6363 steps :
6464 - run :
6565 name : Rust Clippy MySQL
66- command : |
67- cargo clippy --workspace --all-targets --no-default-features --features=mysql,py_verifier -- -D warnings
66+ command : make clippy_mysql
6867 rust-clippy-sqlite :
6968 steps :
7069 - run :
7170 name : Rust Clippy SQLite
72- command : |
73- cargo clippy --workspace --all-targets --no-default-features --features=sqlite,py_verifier -- -D warnings
71+ command : make clippy_sqlite
7472 rust-clippy-spanner :
7573 steps :
7674 - run :
7775 name : Rust Clippy Spanner
78- command : |
79- cargo clippy --workspace --all-targets --no-default-features --features=syncstorage-db/spanner --features=tokenserver-db/mysql --features=py_verifier -- -D warnings
76+ command : make clippy_spanner
8077 setup-mysql :
8178 steps :
8279 - run :
@@ -105,9 +102,9 @@ commands:
105102
106103 install-test-deps :
107104 steps :
108- - run :
105+ - run :
109106 name : Install test dependencies
110- command : cargo install cargo-nextest cargo-llvm-cov
107+ command : cargo install --locked cargo-nextest cargo-llvm-cov
111108
112109 make-test-dir :
113110 steps :
@@ -124,7 +121,7 @@ commands:
124121 name : nextest with code coverage (quota enforced)
125122 command : make test_with_coverage
126123 environment :
127- SYNC_SYNCSTORAGE__ENFORCE_QUOTA : 1
124+ SYNC_SYNCSTORAGE__ENFORCE_QUOTA : 1
128125
129126 merge-unit-test-coverage :
130127 steps :
@@ -146,54 +143,25 @@ commands:
146143 when : always
147144 name : Tokenserver integration tests
148145 command : |
149- # NOTE: Python3.12 requires `--break-system-packages`.
150- # This command is run on the circleci/rust image, which is running python 3.10
151- make run_token_server_integration_tests
152- environment :
153- SYNCSTORAGE_RS_IMAGE : app:build
154- run-e2e-mysql-tests :
155- steps :
156- - run :
157- name : e2e tests (syncstorage mysql)
158- command : >
159- /usr/local/bin/docker-compose
160- -f docker-compose.mysql.yaml
161- -f docker-compose.e2e.mysql.yaml
162- up
163- --exit-code-from mysql-e2e-tests
164- --abort-on-container-exit
165- environment :
166- SYNCSTORAGE_RS_IMAGE : app:build
167-
168- run-e2e-sqlite-tests :
169- steps :
170- - run :
171- name : e2e tests (syncstorage sqlite)
172- command : >
173- /usr/local/bin/docker-compose
174- -f docker-compose.sqlite.yaml
175- -f docker-compose.e2e.sqlite.yaml
176- up
177- --exit-code-from sqlite-e2e-tests
178- --abort-on-container-exit
146+ # NOTE: Python3.12 requires `--break-system-packages`.
147+ # This command is run on the circleci/rust image, which is running python 3.10
148+ make run_token_server_integration_tests
179149 environment :
180- SYNCSTORAGE_RS_IMAGE : app:build
181-
182- run-e2e-spanner-tests :
150+ SYNCSTORAGE_RS_IMAGE : app:build
151+ run-e2e-tests :
152+ parameters :
153+ db :
154+ type : enum
155+ enum : ["mysql", "spanner", "sqlite"]
183156 steps :
184157 - run :
185- name : e2e tests (syncstorage spanner )
158+ name : e2e tests (syncstorage << parameters.db >> )
186159 command : >
187- /usr/local/bin/docker-compose
188- -f docker-compose.spanner.yaml
189- -f docker-compose.e2e.spanner.yaml
190- up
191- --exit-code-from spanner-e2e-tests
192- --abort-on-container-exit
160+ make docker_run_<< parameters.db >>_e2e_tests
193161 environment :
194- SYNCSTORAGE_RS_IMAGE : app:build
162+ SYNCSTORAGE_RS_IMAGE : app:build
195163
196- upload-to-gcs :
164+ gcs-configure-and-upload :
197165 parameters :
198166 source :
199167 type : string
@@ -203,9 +171,13 @@ commands:
203171 type : enum
204172 enum : ["xml", "json"]
205173 steps :
174+ - gcp-cli/setup :
175+ google_project_id : ETE_GOOGLE_PROJECT_ID
176+ gcloud_service_key : ETE_GCLOUD_SERVICE_KEY
177+ google_project_number : ETE_GOOGLE_PROJECT_NUMBER
206178 - run :
207179 name : Upload << parameters.source >> << parameters.extension >> Files to GCS
208- when : always # Ensure the step runs even if previous steps, like test runs, fail
180+ when : always # Ensure the step runs even if previous steps, like test runs, fail
209181 command : |
210182 if [ "$CIRCLE_BRANCH" = "master" ]; then
211183 FILES=$(ls -1 << parameters.source>>/*.<< parameters.extension>> )
@@ -244,7 +216,7 @@ commands:
244216jobs :
245217 checks :
246218 docker :
247- - image : cimg/rust:1.81.0 # RUST_VER
219+ - image : cimg/rust:1.86 # RUST_VER
248220 auth :
249221 username : $DOCKER_USER
250222 password : $DOCKER_PASS
@@ -261,31 +233,27 @@ jobs:
261233
262234 build-and-test :
263235 docker :
264- - image : cimg/rust:1.81.0 # RUST_VER
236+ - image : cimg/rust:1.86 # RUST_VER
265237 auth :
266238 username : $DOCKER_USER
267239 password : $DOCKER_PASS
268240 environment :
269- SYNC_SYNCSTORAGE__DATABASE_URL :
mysql://test:[email protected] /syncstorage 270- SYNC_TOKENSERVER__DATABASE_URL :
mysql://test:[email protected] /tokenserver 271- RUST_BACKTRACE : 1
272- # XXX: begin_test_transaction doesn't play nice over threaded tests
273- RUST_TEST_THREADS : 1
241+ SYNC_SYNCSTORAGE__DATABASE_URL :
mysql://test:[email protected] /syncstorage 242+ SYNC_TOKENSERVER__DATABASE_URL :
mysql://test:[email protected] /tokenserver 243+ RUST_BACKTRACE : 1
244+ # XXX: begin_test_transaction doesn't play nice over threaded tests
245+ RUST_TEST_THREADS : 1
274246 - image : cimg/mysql:5.7
275247 auth :
276248 username : $DOCKER_USER
277249 password : $DOCKER_PASS
278250 environment :
279- MYSQL_ROOT_PASSWORD : password
280- MYSQL_USER : test
281- MYSQL_PASSWORD : test
282- MYSQL_DATABASE : syncstorage
251+ MYSQL_ROOT_PASSWORD : password
252+ MYSQL_USER : test
253+ MYSQL_PASSWORD : test
254+ MYSQL_DATABASE : syncstorage
283255 resource_class : large
284256 steps :
285- - gcp-cli/setup :
286- google_project_id : ETE_GOOGLE_PROJECT_ID
287- gcloud_service_key : ETE_GCLOUD_SERVICE_KEY
288- google_project_number : ETE_GOOGLE_PROJECT_NUMBER
289257 - checkout
290258 - display-versions
291259 - setup-python
@@ -302,20 +270,19 @@ jobs:
302270 # if the above tests don't run tokenserver-db tests (i.e. using --workspace)
303271 # then run-tokenserver-scripts-tests will fail. These tests expect the db to be
304272 # configured already, and it appears unit-tests modify the db to the expected state
305- - run-tokenserver-integration-tests
306273 - store-test-results
307- - upload-to-gcs :
274+ - gcs-configure-and-upload :
308275 source : workflow/test-results
309276 destination : gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
310277 extension : xml
311- - upload-to-gcs :
278+ - gcs-configure-and-upload :
312279 source : workflow/test-results
313280 destination : gs://ecosystem-test-eng-metrics/syncstorage-rs/coverage
314281 extension : json
315282 # - save-sccache-cache
316283 build-mysql-image :
317284 docker :
318- - image : cimg/rust:1.81.0 # RUST_VER
285+ - image : cimg/rust:1.86 # RUST_VER
319286 auth :
320287 username : $DOCKER_USER
321288 password : $DOCKER_PASS
@@ -328,7 +295,10 @@ jobs:
328295 - write-version
329296 - run :
330297 name : Build MySQL Docker image
331- command : docker build -t app:build --build-arg DATABASE_BACKEND=mysql .
298+ command : >
299+ docker build -t app:build
300+ --build-arg DATABASE_BACKEND=mysql
301+ .
332302 no_output_timeout : 30m
333303 # save the built docker container into CircleCI's cache. This is
334304 # required since Workflows do not have the same remote docker instance.
@@ -340,6 +310,9 @@ jobs:
340310 - run :
341311 name : Save docker-compose config
342312 command : cp docker-compose*mysql.yaml /home/circleci/cache
313+ - run :
314+ name : Save Makefile to cache
315+ command : cp Makefile /home/circleci/cache
343316 - save_cache :
344317 key : mysql-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
345318 paths :
@@ -379,7 +352,7 @@ jobs:
379352
380353 build-spanner-image :
381354 docker :
382- - image : cimg/rust:1.81.0 # RUST_VER
355+ - image : cimg/rust:1.86 # RUST_VER
383356 auth :
384357 username : $DOCKER_USER
385358 password : $DOCKER_PASS
@@ -392,7 +365,12 @@ jobs:
392365 - write-version
393366 - run :
394367 name : Build Spanner Docker image
395- command : docker build -t app:build --build-arg DATABASE_BACKEND=spanner .
368+ # Build w/ the Oracle libmysqlclient-dev for TLS support
369+ command : >
370+ docker build -t app:build
371+ --build-arg DATABASE_BACKEND=spanner
372+ --build-arg MYSQLCLIENT_PKG=libmysqlclient-dev
373+ .
396374 no_output_timeout : 30m
397375 # save the built docker container into CircleCI's cache. This is
398376 # required since Workflows do not have the same remote docker instance.
@@ -404,6 +382,9 @@ jobs:
404382 - run :
405383 name : Save docker-compose config
406384 command : cp docker-compose*spanner.yaml /home/circleci/cache
385+ - run :
386+ name : Save Makefile to cache
387+ command : cp Makefile /home/circleci/cache
407388 - save_cache :
408389 key : spanner-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}-{{ epoch }}
409390 paths :
@@ -465,7 +446,7 @@ jobs:
465446
466447 mysql-e2e-tests :
467448 docker :
468- - image : docker/compose:1.24.0
449+ - image : cimg/base:2025.04
469450 auth :
470451 username : $DOCKER_USER
471452 password : $DOCKER_PASS
@@ -477,14 +458,24 @@ jobs:
477458 - run :
478459 name : Restore Docker image cache
479460 command : docker load -i /home/circleci/cache/docker.tar
461+ - run :
462+ name : Restore Makefile from save_cache
463+ command : cp /home/circleci/cache/Makefile .
480464 - run :
481465 name : Restore docker-compose config
482466 command : cp /home/circleci/cache/docker-compose*.yaml .
483- - run-e2e-mysql-tests
467+ - make-test-dir
468+ - run-e2e-tests :
469+ db : mysql
470+ - store-test-results
471+ - gcs-configure-and-upload :
472+ source : workflow/test-results
473+ destination : gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
474+ extension : xml
484475
485476 spanner-e2e-tests :
486477 docker :
487- - image : docker/compose:1.24.0
478+ - image : cimg/base:2025.04
488479 auth :
489480 username : $DOCKER_USER
490481 password : $DOCKER_PASS
@@ -496,10 +487,20 @@ jobs:
496487 - run :
497488 name : Restore Docker image cache
498489 command : docker load -i /home/circleci/cache/docker.tar
490+ - run :
491+ name : Restore Makefile from save_cache
492+ command : cp /home/circleci/cache/Makefile .
499493 - run :
500494 name : Restore docker-compose config
501495 command : cp /home/circleci/cache/docker-compose*.yaml .
502- - run-e2e-spanner-tests
496+ - make-test-dir
497+ - run-e2e-tests :
498+ db : spanner
499+ - store-test-results
500+ - gcs-configure-and-upload :
501+ source : workflow/test-results
502+ destination : gs://ecosystem-test-eng-metrics/syncstorage-rs/junit
503+ extension : xml
503504
504505 sqlite-e2e-tests :
505506 docker :
0 commit comments