From 15666c184579cf1e8cbb13cbb130cf42b1384e48 Mon Sep 17 00:00:00 2001 From: barrfalk Date: Thu, 11 Jul 2024 22:33:06 -0700 Subject: [PATCH] Update .tests.yml --- .github/workflows/.tests.yml | 91 +++++++----------------------------- 1 file changed, 18 insertions(+), 73 deletions(-) diff --git a/.github/workflows/.tests.yml b/.github/workflows/.tests.yml index d52db6a3e..d0f816d70 100644 --- a/.github/workflows/.tests.yml +++ b/.github/workflows/.tests.yml @@ -20,81 +20,26 @@ env: PREFIX: ${{ github.event.repository.name }}-${{ inputs.target }} jobs: - integration-tests: - name: Integration - runs-on: ubuntu-22.04 - timeout-minutes: 1 + cypress-tests: + env: + DOMAIN: apps.silver.devops.gov.bc.ca + PREFIX: ${{ github.event.repository.name }}-${{ github.event.number }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - id: cache-npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-cache-node-modules- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - env: - API_NAME: nest - BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.${{ env.DOMAIN }} - run: | - cd tests/integration - npm ci - node src/main.js + - name: Checkout GitCode + uses: actions/checkout@v3 - e2e-tests: - name: E2E - defaults: - run: - working-directory: frontend - runs-on: ubuntu-22.04 - timeout-minutes: 5 - strategy: - matrix: - project: [Microsoft Edge] - steps: - - uses: actions/checkout@v4 - name: Checkout - - uses: actions/setup-node@v4 - name: Setup Node + - name: Run Cypress Test + uses: cypress-io/github-action@v5 with: - node-version: 20 - cache: "npm" - cache-dependency-path: frontend/package-lock.json - - name: Install dependencies - run: | - npm ci - npx playwright install --with-deps - - - name: Run Tests - env: - E2E_BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.${{ env.DOMAIN }}/ - CI: "true" - run: | - npx playwright test --project="${{ matrix.project }}" --reporter=html + working-directory: ./frontend + command: npx cypress run --browser electron --config baseUrl=https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }} --env auth_base_url=${{ vars.KEYCLOAK_URL_DEV }},auth_realm=${{ vars.KEYCLOAK_REALM }},auth_client_id=${{ vars.KEYCLOAK_CLIENT_ID }},keycloak_user=${{ vars.KEYCLOAK_USER }},keycloak_password=${{ secrets.KEYCLOAK_PASSWORD }} - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - name: upload results - with: - name: playwright-report-${{ matrix.project }} - path: "./frontend/playwright-report" # path from current folder - retention-days: 7 - - load-tests: - name: Load - runs-on: ubuntu-22.04 - strategy: - matrix: - name: [backend, frontend] - steps: - - uses: actions/checkout@v4 - - uses: grafana/k6-action@v0.3.1 - env: - BACKEND_URL: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/api - FRONTEND_URL: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }} + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + if: always() with: - filename: ./tests/load/${{ matrix.name }}-test.js - flags: --vus 10 --duration 30s + name: cypress-artifacts + path: |- + /home/runner/work/nr-compliance-enforcement/nr-compliance-enforcement/frontend/cypress/videos/ + /home/runner/work/nr-compliance-enforcement/nr-compliance-enforcement/frontend/cypress/screenshots/