Просмотр исходного кода

Ensure fakes3 is healthy before running tests

Simon Detheridge 6 лет назад
Родитель
Сommit
237c4113cd
2 измененных файлов с 18 добавлено и 8 удалено
  1. 9 4
      services/filestore/docker-compose.ci.yml
  2. 9 4
      services/filestore/docker-compose.yml

+ 9 - 4
services/filestore/docker-compose.ci.yml

@@ -3,7 +3,7 @@
 # https://github.com/sharelatex/sharelatex-dev-environment
 # Version: 1.1.24
 
-version: "2"
+version: "2.1"
 
 services:
   test_unit:
@@ -33,9 +33,12 @@ services:
       AWS_S3_PUBLIC_FILES_BUCKET_NAME: fake_public_files
       AWS_S3_ENDPOINT: http://fakes3:9090
     depends_on:
-      - mongo
-      - redis
-      - fakes3
+      mongo:
+        condition: service_healthy
+      redis:
+        condition: service_healthy
+      fakes3:
+        condition: service_healthy
     user: node
     command: npm run test:acceptance:_run
 
@@ -59,4 +62,6 @@ services:
     image: adobe/s3mock
     environment:
       - initialBuckets=fake_user_files,fake_template_files,fake_public_files
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:9090"]
 

+ 9 - 4
services/filestore/docker-compose.yml

@@ -3,7 +3,7 @@
 # https://github.com/sharelatex/sharelatex-dev-environment
 # Version: 1.1.24
 
-version: "2"
+version: "2.1"
 
 services:
   test_unit:
@@ -40,9 +40,12 @@ services:
       AWS_S3_ENDPOINT: http://fakes3:9090
     user: node
     depends_on:
-      - mongo
-      - redis
-      - fakes3
+      mongo:
+        condition: service_healthy
+      redis:
+        condition: service_healthy
+      fakes3:
+        condition: service_healthy
     command: npm run test:acceptance
 
 
@@ -65,5 +68,7 @@ services:
     image: adobe/s3mock
     environment:
       - initialBuckets=fake_user_files,fake_template_files,fake_public_files
+    healthcheck:
+      test: ["CMD", "curl", "-f", "http://localhost:9090"]