From b2e50aa53b3d2418123662cf2955c5890c0cd2e8 Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 29 Jul 2024 13:04:09 +0200 Subject: [PATCH] ci: Run E2E tests in parallel for improved performance --- .../openvidu-components-angular-E2E.yml | 92 +++++++++++++++---- 1 file changed, 76 insertions(+), 16 deletions(-) diff --git a/.github/workflows/openvidu-components-angular-E2E.yml b/.github/workflows/openvidu-components-angular-E2E.yml index a9b4f87a..1eb7a121 100644 --- a/.github/workflows/openvidu-components-angular-E2E.yml +++ b/.github/workflows/openvidu-components-angular-E2E.yml @@ -45,9 +45,9 @@ jobs: https://api.github.com/repos/OpenVidu/openvidu-call/dispatches \ -d '{"event_type":"openvidu-components-angular","client_payload":{"commit-message":"'"$COMMIT_MESSAGE"'","commit-ref":"'"$COMMIT_URL"'", "branch-name":"'"$BRANCH_NAME"'"}}' - openvidu__components_angular_e2e: + nested_components_e2e_events: needs: test_setup - name: OpenVidu Components Angular E2E tests + name: Nested events runs-on: ubuntu-latest steps: - name: Checkout Repository @@ -66,12 +66,6 @@ jobs: cd openvidu-local-deployment/community ./configure_lan_private_ip_linux.sh docker compose up -d - - name: Wait for openvidu-local-deployment - run: | - until curl -s -f -o /dev/null http://localhost:7880; do - echo "Waiting for openvidu-local-deployment to be ready..." - sleep 5 - done - name: Run openvidu-call-backend run: | git clone --depth 1 https://github.com/OpenVidu/openvidu-call @@ -88,14 +82,74 @@ jobs: run: npm run build --prefix openvidu-components-angular - name: Serve openvidu-components-angular Testapp run: npm run start --prefix openvidu-components-angular & + - name: Wait for openvidu-local-deployment + run: | + until curl -s -f -o /dev/null http://localhost:7880; do + echo "Waiting for openvidu-local-deployment to be ready..." + sleep 5 + done + - name: Wait for openvidu-components-angular Testapp run: | until curl -s -f -o /dev/null http://localhost:4200; do echo "Waiting for openvidu-components-angular Testapp to be ready..." sleep 5 done - - name: Run openvidu-components-angular E2E - run: npm run lib:e2e-ci --prefix openvidu-components-angular + - name: Run nested components E2E event tests + run: npm run e2e:nested-events-ci --prefix openvidu-components-angular + + nested_components_e2e_directives: + needs: test_setup + name: Nested directives + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit_sha || github.sha }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + - name: Run Browserless Chrome + run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable + - name: Run openvidu-local-deployment + run: | + git clone --depth 1 https://github.com/OpenVidu/openvidu-local-deployment + cd openvidu-local-deployment/community + ./configure_lan_private_ip_linux.sh + docker compose up -d + - name: Run openvidu-call-backend + run: | + git clone --depth 1 https://github.com/OpenVidu/openvidu-call + cd openvidu-call/openvidu-call-back + npm install + npm run dev:start & + - name: Install dependencies + run: | + cd openvidu-components-angular + npm install + - name: Build openvidu-components-angular + run: npm run lib:build --prefix openvidu-components-angular + - name: Build openvidu-components-angular Testapp + run: npm run build --prefix openvidu-components-angular + - name: Serve openvidu-components-angular Testapp + run: npm run start --prefix openvidu-components-angular & + - name: Wait for openvidu-local-deployment + run: | + until curl -s -f -o /dev/null http://localhost:7880; do + echo "Waiting for openvidu-local-deployment to be ready..." + sleep 5 + done + + - name: Wait for openvidu-components-angular Testapp + run: | + until curl -s -f -o /dev/null http://localhost:4200; do + echo "Waiting for openvidu-components-angular Testapp to be ready..." + sleep 5 + done + - name: Run nested components E2E directives tests + run: npm run e2e:nested-directives-ci --prefix openvidu-components-angular # webcomponent_e2e: # needs: test_setup @@ -118,12 +172,6 @@ jobs: # cd openvidu-local-deployment/community # ./configure_lan_private_ip_linux.sh # docker compose up -d - # - name: Wait for openvidu-local-deployment - # run: | - # until curl -s -f -o /dev/null http://localhost:7880; do - # echo "Waiting for openvidu-local-deployment to be ready..." - # sleep 5 - # done # - name: Run openvidu-call-backend # run: | # git clone --depth 1 https://github.com/OpenVidu/openvidu-call @@ -140,5 +188,17 @@ jobs: # run: npm run webcomponent:build --prefix openvidu-components-angular # - name: Serve Webcomponent Testapp # run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular & + # - name: Wait for openvidu-local-deployment + # run: | + # until curl -s -f -o /dev/null http://localhost:7880; do + # echo "Waiting for openvidu-local-deployment to be ready..." + # sleep 5 + # done + # - name: Wait for openvidu-components-angular Testapp + # run: | + # until curl -s -f -o /dev/null http://localhost:4200; do + # echo "Waiting for openvidu-components-angular Testapp to be ready..." + # sleep 5 + # done # - name: Run Webcomponent E2E # run: npm run webcomponent:e2e-ci --prefix openvidu-components-angular