From 26748586264cc8793bd33c82d7b46bfdee47153c Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 7 Mar 2024 17:33:55 +0100 Subject: [PATCH 1/3] First attempt at Playwright integration into pipeline --- .gitea/workflows/ci-pipeline.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 5e89828..91e7142 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -113,6 +113,30 @@ jobs: source venv/bin/activate python main.py + end2end-tests: + needs: test + runs-on: self-hosted + steps: + + - name: Checkout E2E tests repo + uses: actions/checkout@v4 + with: + repository: trustchain-oc1-orchestral/IdHub_E2E_testing + ref: master + token: ${{ secrets.SSIKIT_TOKEN }} + + - name: Install dependencies + run: | + npm ci + + - name: Install Playwright browsers + run: | + npx playwright install --with-deps + + - name: Run Playwright tests + run: | + npx playwright test + deploy: needs: test runs-on: self-hosted From 827756822d575f997dd6ff9d98fcacbb4d123c86 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 7 Mar 2024 19:22:56 +0100 Subject: [PATCH 2/3] Pipeline cleanup & refactor --- .gitea/workflows/ci-pipeline.yaml | 62 ++++++++++++++----------------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 91e7142..0cc2a19 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -57,25 +57,43 @@ jobs: - name: Install dependencies run: | source venv/bin/activate - which python - pip -V pip install --upgrade pip - pip -V - python -V pip install -r requirements.txt if: steps.didkit.outcome == 'success' - - name: Check correct env vars - run: | - echo $DOMAIN - - name: Run tests run: | source venv/bin/activate - echo $DOMAIN coverage run manage.py test - coverage report # python manage.py test + # + - name: Coverage report + run: | + coverage report + + end2end-tests: + needs: test + runs-on: self-hosted + steps: + + - name: Checkout E2E tests repo + uses: actions/checkout@v4 + with: + repository: trustchain-oc1-orchestral/IdHub_E2E_testing + ref: master + token: ${{ secrets.SSIKIT_TOKEN }} + + - name: Install dependencies + run: | + npm ci + + - name: Install Playwright browsers + run: | + npx playwright install --with-deps + + - name: Run Playwright tests + run: | + npx playwright test ssikit-tests: needs: test @@ -113,30 +131,6 @@ jobs: source venv/bin/activate python main.py - end2end-tests: - needs: test - runs-on: self-hosted - steps: - - - name: Checkout E2E tests repo - uses: actions/checkout@v4 - with: - repository: trustchain-oc1-orchestral/IdHub_E2E_testing - ref: master - token: ${{ secrets.SSIKIT_TOKEN }} - - - name: Install dependencies - run: | - npm ci - - - name: Install Playwright browsers - run: | - npx playwright install --with-deps - - - name: Run Playwright tests - run: | - npx playwright test - deploy: needs: test runs-on: self-hosted From 657ca221f6b7fa32dea5b2853c86ccc48e46647e Mon Sep 17 00:00:00 2001 From: Elijah Date: Fri, 8 Mar 2024 11:24:56 +0100 Subject: [PATCH 3/3] Deploy testing instances before running E2E testing --- .gitea/workflows/ci-pipeline.yaml | 51 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml index 0cc2a19..8f8f3e1 100644 --- a/.gitea/workflows/ci-pipeline.yaml +++ b/.gitea/workflows/ci-pipeline.yaml @@ -69,32 +69,9 @@ jobs: # - name: Coverage report run: | + source venv/bin/activate coverage report - end2end-tests: - needs: test - runs-on: self-hosted - steps: - - - name: Checkout E2E tests repo - uses: actions/checkout@v4 - with: - repository: trustchain-oc1-orchestral/IdHub_E2E_testing - ref: master - token: ${{ secrets.SSIKIT_TOKEN }} - - - name: Install dependencies - run: | - npm ci - - - name: Install Playwright browsers - run: | - npx playwright install --with-deps - - - name: Run Playwright tests - run: | - npx playwright test - ssikit-tests: needs: test runs-on: self-hosted @@ -131,7 +108,7 @@ jobs: source venv/bin/activate python main.py - deploy: + deploy-testing-instances: needs: test runs-on: self-hosted steps: @@ -148,3 +125,27 @@ jobs: exit 0 fi if: success() && github.ref == 'refs/heads/release' + + end2end-tests: + needs: deploy-testing-instances + runs-on: self-hosted + steps: + + - name: Checkout E2E tests repo + uses: actions/checkout@v4 + with: + repository: trustchain-oc1-orchestral/IdHub_E2E_testing + ref: master + token: ${{ secrets.SSIKIT_TOKEN }} + + - name: Install dependencies + run: | + npm ci + + - name: Install Playwright browsers + run: | + npx playwright install --with-deps + + - name: Run Playwright tests + run: | + npx playwright test