From ab109f543a08f5241afb77d1161d8b2a334fcad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Sat, 16 Dec 2023 09:55:45 +0100 Subject: [PATCH 1/6] Wait for emulator to start --- .github/actions/setup_test_action/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup_test_action/action.yml b/.github/actions/setup_test_action/action.yml index 1b18c9db4..1fc129725 100644 --- a/.github/actions/setup_test_action/action.yml +++ b/.github/actions/setup_test_action/action.yml @@ -24,7 +24,12 @@ runs: run: chmod +x gradlew - name: Install Firebase tools shell: bash - run: npm install -g firebase-tools + run: npm install -g firebase-tools wait-on - name: Start Firebase emulator shell: bash - run: "firebase emulators:start --config=./test/firebase.json &" \ No newline at end of file + run: | + firebase emulators:start --config=./test/firebase.json & + wait-on http://localhost:9099 + wait-on http://localhost:8080 + wait-on http://localhost:9000 + wait-on http://localhost:9199 \ No newline at end of file From 6def555f0b4bac195c7101bc967d5f17d30505fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Sat, 16 Dec 2023 10:16:02 +0100 Subject: [PATCH 2/6] Change host to 127.0.0.1, add timeout and debug logs --- .github/actions/setup_test_action/action.yml | 12 ++++++++---- .github/workflows/pull_request.yml | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup_test_action/action.yml b/.github/actions/setup_test_action/action.yml index 1fc129725..6c5eb7d47 100644 --- a/.github/actions/setup_test_action/action.yml +++ b/.github/actions/setup_test_action/action.yml @@ -29,7 +29,11 @@ runs: shell: bash run: | firebase emulators:start --config=./test/firebase.json & - wait-on http://localhost:9099 - wait-on http://localhost:8080 - wait-on http://localhost:9000 - wait-on http://localhost:9199 \ No newline at end of file + echo "Waiting for Firebase Auth emulator to start..." + wait-on http://127.0.0.1:9099 + echo "Waiting for Firebase Firestore emulator to start..." + wait-on http://127.0.0.1:8080 + echo "Waiting for Firebase Database emulator to start..." + wait-on http://127.0.0.1:9000 + echo "Waiting for Firebase Storage emulator to start..." + wait-on http://127.0.0.1:9199 \ No newline at end of file diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 31d9d58e2..55e4c9e21 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -66,6 +66,7 @@ jobs: - uses: actions/checkout@v3 - name: Setup test environment uses: ./.github/actions/setup_test_action + timeout-minutes: 10 - name: Run JS Tests run: ./gradlew cleanTest jsTest - name: Upload JS test artifact From 57c1391177afdea1e2c74006d1284de2f0415524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Sat, 16 Dec 2023 10:24:49 +0100 Subject: [PATCH 3/6] Split start and wait into 2 steps --- .github/actions/setup_test_action/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup_test_action/action.yml b/.github/actions/setup_test_action/action.yml index 6c5eb7d47..be2743da9 100644 --- a/.github/actions/setup_test_action/action.yml +++ b/.github/actions/setup_test_action/action.yml @@ -26,9 +26,11 @@ runs: shell: bash run: npm install -g firebase-tools wait-on - name: Start Firebase emulator + shell: bash + run: firebase emulators:start --config=./test/firebase.json & + - name: Wait for Firebase emulator to start shell: bash run: | - firebase emulators:start --config=./test/firebase.json & echo "Waiting for Firebase Auth emulator to start..." wait-on http://127.0.0.1:9099 echo "Waiting for Firebase Firestore emulator to start..." From 798a99f671062293f422c28195037d9fda5d9597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Sat, 16 Dec 2023 11:03:41 +0100 Subject: [PATCH 4/6] Wait only for auth emulator --- .github/actions/setup_test_action/action.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/actions/setup_test_action/action.yml b/.github/actions/setup_test_action/action.yml index be2743da9..ba5441480 100644 --- a/.github/actions/setup_test_action/action.yml +++ b/.github/actions/setup_test_action/action.yml @@ -26,16 +26,7 @@ runs: shell: bash run: npm install -g firebase-tools wait-on - name: Start Firebase emulator - shell: bash - run: firebase emulators:start --config=./test/firebase.json & - - name: Wait for Firebase emulator to start shell: bash run: | - echo "Waiting for Firebase Auth emulator to start..." + firebase emulators:start --config=./test/firebase.json & wait-on http://127.0.0.1:9099 - echo "Waiting for Firebase Firestore emulator to start..." - wait-on http://127.0.0.1:8080 - echo "Waiting for Firebase Database emulator to start..." - wait-on http://127.0.0.1:9000 - echo "Waiting for Firebase Storage emulator to start..." - wait-on http://127.0.0.1:9199 \ No newline at end of file From 9963accae440b72986ccfff1555bb1dfae5c350d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Tue, 19 Dec 2023 22:24:06 +0100 Subject: [PATCH 5/6] Restart tests --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 55e4c9e21..dcfd8346c 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -113,4 +113,4 @@ jobs: if: failure() with: name: "Firebase Debug Log" - path: "**/firebase-debug.log" + path: "**/firebase-debug.log" \ No newline at end of file From e06ca79c33cc7dfc2ced431c87e3e3645853098a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Sk=C3=A1la?= Date: Wed, 20 Dec 2023 14:36:58 +0100 Subject: [PATCH 6/6] Clear cocoapods cache --- .github/workflows/pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dcfd8346c..63fb749a0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -90,14 +90,13 @@ jobs: - uses: actions/checkout@v3 - name: Cocoapods cache uses: actions/cache@v3 - id: cocoapods-cache with: path: | ~/.cocoapods ~/Library/Caches/CocoaPods */build/cocoapods */build/classes - key: cocoapods-cache + key: cocoapods-cache-v2 - name: Setup test environment uses: ./.github/actions/setup_test_action - name: Run iOS Tests