From 2606acc8d9ebe6d2a64390f3bfbc04d7f9850f96 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 14:11:16 -0300 Subject: [PATCH 01/11] Split lint and typecheck --- .github/workflows/build_and_test.yml | 99 +++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 332e78502475..f5d9f2c52df8 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -146,15 +146,9 @@ jobs: repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} - - name: Lint - run: yarn lint --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - - name: Translation check run: yarn turbo run translation-check --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - - name: TS typecheck - run: yarn turbo run typecheck --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - - name: Reset Meteor if: startsWith(github.ref, 'refs/tags/') == 'true' || github.ref == 'refs/heads/develop' working-directory: ./apps/meteor @@ -181,9 +175,96 @@ jobs: name: build path: /tmp/Rocket.Chat.tar.gz + ts-typecheck: + runs-on: ubuntu-20.04 + + steps: + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 4 + + - uses: actions/checkout@v3 + + - name: Use Node.js 14.21.2 + uses: actions/setup-node@v3 + with: + node-version: '14.21.2' + cache: 'yarn' + + - name: Free disk space + run: | + sudo apt clean + docker rmi $(docker image ls -aq) + df -h + + - name: Versions + run: | + npm --versions + yarn -v + node -v + git version + + - name: yarn install + run: yarn + + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + if: "${{ env.TURBO_TEAM != '' }}" + with: + repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} + server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + + - name: TS typecheck + run: yarn turbo run typecheck --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' + + lint: + runs-on: ubuntu-20.04 + + steps: + - name: Set Swap Space + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 4 + + - uses: actions/checkout@v3 + + - name: Use Node.js 14.21.2 + uses: actions/setup-node@v3 + with: + node-version: '14.21.2' + cache: 'yarn' + + - name: Free disk space + run: | + sudo apt clean + docker rmi $(docker image ls -aq) + df -h + + - name: Versions + run: | + npm --versions + yarn -v + node -v + git version + + - name: yarn install + run: yarn + + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + if: "${{ env.TURBO_TEAM != '' }}" + with: + repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} + server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + + - name: Lint + run: yarn lint --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' + + build-docker-preview: runs-on: ubuntu-20.04 - needs: [build, release-versions] + needs: [build, lint, ts-typecheck release-versions] if: github.event_name == 'release' || github.ref == 'refs/heads/develop' steps: - uses: actions/checkout@v3 @@ -218,7 +299,7 @@ jobs: test: runs-on: ubuntu-20.04 - needs: [build, release-versions] + needs: [build, lint, ts-typecheck, release-versions] strategy: matrix: @@ -419,7 +500,7 @@ jobs: test-ee: runs-on: ubuntu-20.04 - needs: [build, release-versions] + needs: [build, lint, ts-typecheck, release-versions] strategy: matrix: From 35cb8a0577c026fac52a17c7cf339ae75118b64b Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 14:29:23 -0300 Subject: [PATCH 02/11] Split tests --- .github/workflows/build_and_test.yml | 253 ++++++++++++++++++++++----- 1 file changed, 212 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index f5d9f2c52df8..d665750fc3af 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -261,7 +261,6 @@ jobs: - name: Lint run: yarn lint --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - build-docker-preview: runs-on: ubuntu-20.04 needs: [build, lint, ts-typecheck release-versions] @@ -297,7 +296,44 @@ jobs: username: ${{ secrets.CR_USER }} password: ${{ secrets.CR_PAT }} - test: + test-unit: + runs-on: ubuntu-20.04 + needs: [build, lint, ts-typecheck, release-versions] + + strategy: + matrix: + node-version: ['14.21.2'] + mongodb-version: ['4.4', '5.0', '6.0'] + + steps: + - name: Launch MongoDB + uses: supercharge/mongodb-github-action@1.8.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + mongodb-replica-set: rs0 + + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + - name: yarn install + run: yarn + + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + if: "${{ env.TURBO_TEAM != '' }}" + with: + repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} + server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + + - name: Unit Test + run: yarn testunit --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' + + test-api: runs-on: ubuntu-20.04 needs: [build, lint, ts-typecheck, release-versions] @@ -354,9 +390,6 @@ jobs: repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} - - name: Unit Test - run: yarn testunit --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - - name: Restore build uses: actions/download-artifact@v2 with: @@ -451,42 +484,115 @@ jobs: done; exit $s - - name: Cache Playwright binaries - uses: actions/cache@v3 - id: cache-playwright + test-e2e: + runs-on: ubuntu-20.04 + needs: [build, lint, ts-typecheck, release-versions] + + strategy: + matrix: + node-version: ['14.21.2'] + mongodb-version: ['4.4', '5.0', '6.0'] + + steps: + - name: Launch MongoDB + uses: supercharge/mongodb-github-action@1.8.0 with: - path: | - ~/.cache/ms-playwright - # This is the version of Playwright that we are using, if you are willing to upgrade, you should update this. - key: playwright-1.23.1 + mongodb-version: ${{ matrix.mongodb-version }} + mongodb-replica-set: rs0 - - name: Install Playwright - if: steps.cache-playwright.outputs.cache-hit != 'true' - working-directory: ./apps/meteor - run: npx playwright install --with-deps + - name: Docker env vars + id: docker-env + run: | + LOWERCASE_REPOSITORY=$(echo "${{ github.repository_owner }}" | tr "[:upper:]" "[:lower:]") + + echo "LOWERCASE_REPOSITORY: ${LOWERCASE_REPOSITORY}" + echo "::set-output name=lowercase-repo::${LOWERCASE_REPOSITORY}" + + # test alpine image on mongo 5.0 (no special reason to be mongo 5.0 but we need to test alpine at least once) + if [[ '${{ matrix.mongodb-version }}' = '5.0' ]]; then + RC_DOCKERFILE="${{ github.workspace }}/apps/meteor/.docker/Dockerfile.alpine" + RC_DOCKER_TAG="${{ needs.release-versions.outputs.gh-docker-tag }}.alpine" + else + RC_DOCKERFILE="${{ github.workspace }}/apps/meteor/.docker/Dockerfile" + RC_DOCKER_TAG="${{ needs.release-versions.outputs.gh-docker-tag }}.official" + fi; + + echo "RC_DOCKERFILE: ${RC_DOCKERFILE}" + echo "::set-output name=rc-dockerfile::${RC_DOCKERFILE}" + + echo "RC_DOCKER_TAG: ${RC_DOCKER_TAG}" + echo "::set-output name=rc-docker-tag::${RC_DOCKER_TAG}" + + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + - name: yarn install + run: yarn + + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + if: "${{ env.TURBO_TEAM != '' }}" + with: + repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} + server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + + - name: Restore build + uses: actions/download-artifact@v2 + with: + name: build + path: /tmp/build + + - name: Unpack build + run: | + cd /tmp/build + tar xzf Rocket.Chat.tar.gz + rm Rocket.Chat.tar.gz - - name: Reset containers + - name: Start containers env: + MONGO_URL: 'mongodb://host.docker.internal:27017/rocketchat?replicaSet=rs0&directConnection=true' + MONGO_OPLOG_URL: 'mongodb://mongodb:27017/local?replicaSet=rs0&directConnection=true' LOWERCASE_REPOSITORY: ${{ steps.docker-env.outputs.lowercase-repo }} RC_DOCKERFILE: ${{ steps.docker-env.outputs.rc-dockerfile }} RC_DOCKER_TAG: ${{ steps.docker-env.outputs.rc-docker-tag }} + DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} run: | - docker ps - - docker compose -f docker-compose-ci.yml stop rocketchat - - docker exec mongodb bash -c 'if command -v mongosh ; then mongosh --eval "use rocketchat" --eval "db.dropDatabase()" rocketchat; else mongo rocketchat --eval "db.dropDatabase()"; fi' - - NOW=$(date "+%Y-%m-%dT%H:%M:%S.000Z") + docker compose -f docker-compose-ci.yml up -d --build rocketchat - docker compose -f docker-compose-ci.yml restart rocketchat + - name: Wait for Rocket.Chat to start up + env: + LOWERCASE_REPOSITORY: ${{ steps.docker-env.outputs.lowercase-repo }} + RC_DOCKERFILE: ${{ steps.docker-env.outputs.rc-dockerfile }} + RC_DOCKER_TAG: ${{ steps.docker-env.outputs.rc-docker-tag }} + DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} + run: | + docker ps - until echo "$(docker compose -f docker-compose-ci.yml logs rocketchat --since $NOW)" | grep -q "SERVER RUNNING"; do + until echo "$(docker compose -f docker-compose-ci.yml logs rocketchat)" | grep -q "SERVER RUNNING"; do echo "Waiting Rocket.Chat to start up" - ((c++)) && ((c==10)) && exit 1 + ((c++)) && ((c==10)) && docker compose -f docker-compose-ci.yml logs rocketchat && exit 1 sleep 10 done; + - name: Cache Playwright binaries + uses: actions/cache@v3 + id: cache-playwright + with: + path: | + ~/.cache/ms-playwright + # This is the version of Playwright that we are using, if you are willing to upgrade, you should update this. + key: playwright-1.23.1 + + - name: Install Playwright + if: steps.cache-playwright.outputs.cache-hit != 'true' + working-directory: ./apps/meteor + run: npx playwright install --with-deps + - name: E2E Test UI working-directory: ./apps/meteor run: yarn test:e2e @@ -498,7 +604,7 @@ jobs: name: playwright-test-trace path: ./apps/meteor/tests/e2e/.playwright* - test-ee: + test-ee-api: runs-on: ubuntu-20.04 needs: [build, lint, ts-typecheck, release-versions] @@ -640,20 +746,91 @@ jobs: done; exit $s - - name: Reset containers + test-ee-e2e: + runs-on: ubuntu-20.04 + needs: [build, lint, ts-typecheck, release-versions] + + strategy: + matrix: + node-version: ['14.21.2'] + mongodb-version-ee: ['4.4'] + + steps: + - name: Launch MongoDB + uses: supercharge/mongodb-github-action@1.8.0 + with: + mongodb-version: ${{ matrix.mongodb-version-ee }} + mongodb-replica-set: rs0 + + - uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + + - name: TurboRepo local server + uses: felixmosh/turborepo-gh-artifacts@v2 + if: "${{ env.TURBO_TEAM != '' }}" + with: + repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} + server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + + - name: yarn install + run: yarn + + - name: yarn build + run: yarn build + + - name: Restore build + uses: actions/download-artifact@v2 + with: + name: build + path: /tmp/build + + - name: Unpack build + run: | + cd /tmp/build + tar xzf Rocket.Chat.tar.gz + rm Rocket.Chat.tar.gz + + - name: Docker env vars + id: docker-env + run: | + LOWERCASE_REPOSITORY=$(echo "${{ github.repository_owner }}" | tr "[:upper:]" "[:lower:]") + + echo "LOWERCASE_REPOSITORY: ${LOWERCASE_REPOSITORY}" + echo "::set-output name=lowercase-repo::${LOWERCASE_REPOSITORY}" + + - name: Start containers env: + MONGO_URL: 'mongodb://host.docker.internal:27017/rocketchat?replicaSet=rs0&directConnection=true' LOWERCASE_REPOSITORY: ${{ steps.docker-env.outputs.lowercase-repo }} RC_DOCKERFILE: '${{ github.workspace }}/apps/meteor/.docker/Dockerfile' RC_DOCKER_TAG: '${{ needs.release-versions.outputs.gh-docker-tag }}.official' DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} + TRANSPORTER: nats://nats:4222 + # this is 100% intentional, secrets are not available for forks, so ee-tests will always fail + # to avoid this, we are using a dummy license, expiring at 2023-06-30 + ENTERPRISE_LICENSE: Z2Dg0RC3kyxjuklSE6qfqyvD2xSD+oTYcS9OesJG0523r7rSPjv59LTQqPcp5E61qQYM3MOKoW3mDrurw4h78nVbsfrF2DoJZeNjRFQfIbgwcdPwtmnqPpDvAslszHY16VzM7O7EYqAqp/9mlnRzs1iJY+W3w1r6HWBlVMb9u41bl5HBSpX6Nxw8YxL4mizwOpjxewQbPQvNTLJNAW6w0nCzF5A3CKBhD9fziadedVMLOuXBuR8kIl8zbIAfqpHmL8SvakvQAbZEjWWQshmH+C9CKA5PppkmA8Q1DNWQoVtHSiYDK8RRjAEx+0oGflklzFyhJFDvD+ohZduNtNCgrJmxP5VFrVrLSK4BXgTSwwnaSKa2N+Qx0CmuRfu7nCPc1Cf6h6+k2TXvzkE4Z0ZJnDV1khu611glAr99bHdwF+bMX3XZI66bS8KqnHEukCt5xei25iKJ2xrfmGuiAkAuKHKzBmTEmXM0pGhkfDhA9jhxG3Atoj1A5y8vdrs88voF+UuNFZ6k9sKtdvrWIWClnkatPE+41ggbzCsOhFz07BvRWaEtw2Kenipl4Vtag4qmFpUaUfsuouH99M3gDlysDZO3x5aH8yfzvFeL5WDMvsmdEHNLpHl89WsPCONvx0JjRSdwcCA1NrRuVy1Ncu0S0bRByn7HZqoY9u6HPkXKBxQ= run: | - docker compose -f docker-compose-ci.yml stop - - docker exec mongodb bash -c 'if command -v mongosh ; then mongosh --eval "use rocketchat" --eval "db.dropDatabase()" rocketchat; else mongo rocketchat --eval "db.dropDatabase()"; fi' + docker compose -f docker-compose-ci.yml up -d --build - NOW=$(date "+%Y-%m-%dT%H:%M:%S.000Z") + - name: Wait services to start up + env: + LOWERCASE_REPOSITORY: ${{ steps.docker-env.outputs.lowercase-repo }} + RC_DOCKERFILE: '${{ github.workspace }}/apps/meteor/.docker/Dockerfile' + RC_DOCKER_TAG: '${{ needs.release-versions.outputs.gh-docker-tag }}.official' + DOCKER_TAG: ${{ needs.release-versions.outputs.gh-docker-tag }} + run: | + docker ps - docker compose -f docker-compose-ci.yml restart + until echo "$(docker compose -f docker-compose-ci.yml logs rocketchat)" | grep -q "SERVER RUNNING"; do + echo "Waiting Rocket.Chat to start up" + ((c++)) && ((c==10)) && docker compose -f docker-compose-ci.yml logs rocketchat && exit 1 + sleep 10 + done; until echo "$(docker compose -f docker-compose-ci.yml logs ddp-streamer-service)" | grep -q "NetworkBroker started successfully"; do echo "Waiting 'ddp-streamer' to start up" @@ -661,12 +838,6 @@ jobs: sleep 10 done; - until echo "$(docker compose -f docker-compose-ci.yml logs rocketchat)" | grep -q "SERVER RUNNING"; do - echo "Waiting Rocket.Chat to start up" - ((c++)) && ((c==10)) && docker compose -f docker-compose-ci.yml logs rocketchat && exit 1 - sleep 10 - done; - - name: Cache Playwright binaries uses: actions/cache@v3 id: cache-playwright @@ -710,7 +881,7 @@ jobs: deploy: runs-on: ubuntu-20.04 if: github.event_name == 'release' || github.ref == 'refs/heads/develop' - needs: [test, test-ee, release-versions] + needs: [test-unit, test-api, test-e2e, test-ee-api, test-ee-e2e, release-versions] steps: - uses: actions/checkout@v3 From 59f512d366db85358044b9088adc6c5127bf1f12 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 14:40:59 -0300 Subject: [PATCH 03/11] Fix yml --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index d665750fc3af..522e7664fe23 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -263,7 +263,7 @@ jobs: build-docker-preview: runs-on: ubuntu-20.04 - needs: [build, lint, ts-typecheck release-versions] + needs: [build, lint, ts-typecheck, release-versions] if: github.event_name == 'release' || github.ref == 'refs/heads/develop' steps: - uses: actions/checkout@v3 From f05d15d9178412639f6e41a026e081410ab253c6 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 14:48:47 -0300 Subject: [PATCH 04/11] Fix lint on meteor app --- apps/meteor/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 7405795e5519..3b596367a372 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -24,7 +24,7 @@ "migration:add": "ts-node-transpile-only --skip-project .scripts/make-migration.ts", "debug": "meteor run --inspect", "debug-brk": "meteor run --inspect-brk", - "lint": "meteor npm run stylelint && meteor npm run eslint", + "lint": "npm run stylelint && npm run eslint", "eslint": "eslint --ext .js,.jsx,.ts,.tsx .", "eslint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", "obj:dev": "TEST_MODE=true yarn dev", From 4e27267ce478701a2c5b06f5d4135a98e487a3b5 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 16:01:49 -0300 Subject: [PATCH 05/11] Fix build for test --- .github/workflows/build_and_test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 522e7664fe23..e4894c8cbd15 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -383,6 +383,9 @@ jobs: - name: yarn install run: yarn + - name: yarn build + run: yarn build + - name: TurboRepo local server uses: felixmosh/turborepo-gh-artifacts@v2 if: "${{ env.TURBO_TEAM != '' }}" @@ -534,6 +537,9 @@ jobs: - name: yarn install run: yarn + - name: yarn build + run: yarn build + - name: TurboRepo local server uses: felixmosh/turborepo-gh-artifacts@v2 if: "${{ env.TURBO_TEAM != '' }}" From 5d37615b2ccb0f416e1e3488d8d958a559f20f19 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 16:39:23 -0300 Subject: [PATCH 06/11] Move yarn build to after turborepo init --- .github/workflows/build_and_test.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 1e05042670de..4126d25509b1 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -380,12 +380,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'yarn' - - name: yarn install - run: yarn - - - name: yarn build - run: yarn build - - name: TurboRepo local server uses: felixmosh/turborepo-gh-artifacts@v2 if: "${{ env.TURBO_TEAM != '' }}" @@ -393,6 +387,12 @@ jobs: repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + - name: yarn install + run: yarn + + - name: yarn build + run: yarn build --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' + - name: Restore build uses: actions/download-artifact@v2 with: @@ -534,12 +534,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'yarn' - - name: yarn install - run: yarn - - - name: yarn build - run: yarn build - - name: TurboRepo local server uses: felixmosh/turborepo-gh-artifacts@v2 if: "${{ env.TURBO_TEAM != '' }}" @@ -547,6 +541,12 @@ jobs: repo-token: ${{ secrets.RC_TURBO_GH_TOKEN }} server-token: ${{ secrets.TURBO_SERVER_TOKEN }} + - name: yarn install + run: yarn + + - name: yarn build + run: yarn build --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' + - name: Restore build uses: actions/download-artifact@v2 with: @@ -645,7 +645,7 @@ jobs: run: yarn - name: yarn build - run: yarn build + run: yarn build --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - name: Restore build uses: actions/download-artifact@v2 @@ -787,7 +787,7 @@ jobs: run: yarn - name: yarn build - run: yarn build + run: yarn build --api="http://127.0.0.1:9080" --token="${{ secrets.TURBO_SERVER_TOKEN }}" --team='rc' - name: Restore build uses: actions/download-artifact@v2 From e31ad245a9021ccd1a9e7fe1727482a2cc33fd0a Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 18:34:19 -0300 Subject: [PATCH 07/11] Aggregate test finishes --- .github/workflows/build_and_test.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 4126d25509b1..6d7c71988dfd 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -888,10 +888,19 @@ jobs: name: e2e-ee-coverage path: ./apps/meteor/coverage* + test: + runs-on: ubuntu-20.04 + needs: [test-unit, test-api, test-e2e, test-ee-api, test-ee-e2e] + + steps: + - name: Test finish aggregation + run: | + echo finished + deploy: runs-on: ubuntu-20.04 if: github.event_name == 'release' || github.ref == 'refs/heads/develop' - needs: [test-unit, test-api, test-e2e, test-ee-api, test-ee-e2e, release-versions] + needs: [test, release-versions] steps: - uses: actions/checkout@v3 From 53f36b89846bbcd1232fcb13bb694136e05a5636 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 16 Feb 2023 18:34:57 -0300 Subject: [PATCH 08/11] Rename test e2e to ui --- .github/workflows/build_and_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 6d7c71988dfd..e5b408411d24 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -487,7 +487,7 @@ jobs: done; exit $s - test-e2e: + test-ui: runs-on: ubuntu-20.04 needs: [build, lint, ts-typecheck, release-versions] @@ -752,7 +752,7 @@ jobs: done; exit $s - test-ee-e2e: + test-ee-ui: runs-on: ubuntu-20.04 needs: [build, lint, ts-typecheck, release-versions] @@ -890,7 +890,7 @@ jobs: test: runs-on: ubuntu-20.04 - needs: [test-unit, test-api, test-e2e, test-ee-api, test-ee-e2e] + needs: [test-unit, test-api, test-ui, test-ee-api, test-ee-ui] steps: - name: Test finish aggregation From 146906575a5d09aa495763c3e76fdfeeffd30cc8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 16 Feb 2023 18:41:28 -0300 Subject: [PATCH 09/11] Add Sharding for e2e ui tests --- .github/workflows/build_and_test.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e5b408411d24..c3f16fe61759 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -340,7 +340,7 @@ jobs: strategy: matrix: node-version: ['14.21.2'] - mongodb-version: ['4.4', '5.0', '6.0'] + mongodb-version: ['4.4', '6.0'] steps: - name: Launch MongoDB @@ -357,8 +357,8 @@ jobs: echo "LOWERCASE_REPOSITORY: ${LOWERCASE_REPOSITORY}" echo "::set-output name=lowercase-repo::${LOWERCASE_REPOSITORY}" - # test alpine image on mongo 5.0 (no special reason to be mongo 5.0 but we need to test alpine at least once) - if [[ '${{ matrix.mongodb-version }}' = '5.0' ]]; then + # test alpine image on mongo 6.0 (no special reason to be mongo 6.0 but we need to test alpine at least once) + if [[ '${{ matrix.mongodb-version }}' = '6.0' ]]; then RC_DOCKERFILE="${{ github.workspace }}/apps/meteor/.docker/Dockerfile.alpine" RC_DOCKER_TAG="${{ needs.release-versions.outputs.gh-docker-tag }}.alpine" else @@ -494,7 +494,8 @@ jobs: strategy: matrix: node-version: ['14.21.2'] - mongodb-version: ['4.4', '5.0', '6.0'] + mongodb-version: ['4.4', '6.0'] + shard: [1, 2, 3, 4] steps: - name: Launch MongoDB @@ -511,8 +512,8 @@ jobs: echo "LOWERCASE_REPOSITORY: ${LOWERCASE_REPOSITORY}" echo "::set-output name=lowercase-repo::${LOWERCASE_REPOSITORY}" - # test alpine image on mongo 5.0 (no special reason to be mongo 5.0 but we need to test alpine at least once) - if [[ '${{ matrix.mongodb-version }}' = '5.0' ]]; then + # test alpine image on mongo 6.0 (no special reason to be mongo 6.0 but we need to test alpine at least once) + if [[ '${{ matrix.mongodb-version }}' = '6.0' ]]; then RC_DOCKERFILE="${{ github.workspace }}/apps/meteor/.docker/Dockerfile.alpine" RC_DOCKER_TAG="${{ needs.release-versions.outputs.gh-docker-tag }}.alpine" else @@ -599,9 +600,9 @@ jobs: working-directory: ./apps/meteor run: npx playwright install --with-deps - - name: E2E Test UI + - name: E2E Test UI (${{ matrix.shard }}/4) working-directory: ./apps/meteor - run: yarn test:e2e + run: yarn test:e2e --shard=${{ matrix.shard }}/4 - name: Store playwright test trace uses: actions/upload-artifact@v3 From 70cb45dfab38ca3378b8d8ca2e0d4ba93bd8dd58 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 16 Feb 2023 19:15:32 -0300 Subject: [PATCH 10/11] add ee shard --- .github/workflows/build_and_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index c3f16fe61759..37b8b2b665d3 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -761,6 +761,7 @@ jobs: matrix: node-version: ['14.21.2'] mongodb-version-ee: ['4.4'] + shard: [1, 2, 3, 4] steps: - name: Launch MongoDB @@ -858,9 +859,9 @@ jobs: working-directory: ./apps/meteor run: npx playwright install --with-deps - - name: E2E Test UI + - name: E2E Test UI (${{ matrix.shard }}/4) working-directory: ./apps/meteor - run: E2E_COVERAGE=true IS_EE=true yarn test:e2e + run: E2E_COVERAGE=true IS_EE=true yarn test:e2e --shard=${{ matrix.shard }}/4 - name: Show server logs if E2E test failed if: failure() From f276cee0a6b99112b92a1f9e42f11a292d21e150 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 16 Feb 2023 19:55:46 -0300 Subject: [PATCH 11/11] split ee into 5 shard --- .github/workflows/build_and_test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 37b8b2b665d3..3c61d0519fe7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -761,7 +761,7 @@ jobs: matrix: node-version: ['14.21.2'] mongodb-version-ee: ['4.4'] - shard: [1, 2, 3, 4] + shard: [1, 2, 3, 4, 5] steps: - name: Launch MongoDB @@ -861,7 +861,7 @@ jobs: - name: E2E Test UI (${{ matrix.shard }}/4) working-directory: ./apps/meteor - run: E2E_COVERAGE=true IS_EE=true yarn test:e2e --shard=${{ matrix.shard }}/4 + run: E2E_COVERAGE=true IS_EE=true yarn test:e2e --shard=${{ matrix.shard }}/5 - name: Show server logs if E2E test failed if: failure()