Skip to content

Commit

Permalink
Test to see if this works on prs
Browse files Browse the repository at this point in the history
  • Loading branch information
asteel-gsa committed Oct 5, 2023
1 parent 1528abd commit 25e5772
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/local-regression-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
name: Regression Tests for Pull Requests
on:
push:
branches:
- pd/2311-pr-regression-tests
# push:
# branches:
# - pd/2311-pr-regression-tests
# workflow_dispatch:
# inputs:
# url:
Expand Down
49 changes: 41 additions & 8 deletions .github/workflows/testing-from-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,20 @@ jobs:
npm run test:a11y:lighthouse
npm run test:a11y:pa11y
regression-tests:
regression-testing:
runs-on: ubuntu-latest
environment: dev
env:
# Container Related ENV
ENV: TESTING
SAM_API_KEY: ${{ secrets.SAM_API_KEY }}
DJANGO_BASE_URL: 'http://localhost:8000'
DJANGO_SECRET_LOGIN_KEY: ${{ secrets.DJANGO_SECRET_LOGIN_KEY }}
LOGIN_CLIENT_ID: ${{ secrets.LOGIN_CLIENT_ID }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: '0.0.0.0 127.0.0.1 localhost'
PGRST_JWT_SECRET: ${{ secrets.PGRST_JWT_SECRET }}
# Cypress Related ENV
CYPRESS_API_GOV_KEY: ${{ secrets.CYPRESS_API_GOV_KEY }}
CYPRESS_API_GOV_URL: ${{ secrets.CYPRESS_API_GOV_URL }}
CYPRESS_BASE_URL: 'http://localhost:8000'
Expand All @@ -107,15 +117,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Start services
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Start Services
working-directory: ./backend
run: |
touch .env
docker compose -f docker-compose.yml up -d
docker compose -f docker-compose-web.yml up -d
- name: Install npm dependencies
working-directory: ./backend
run: sudo npm install

- name: Remove node_modules/ so cypress-io/github-action@v6 works
run: sudo rm -rf /home/runner/work/FAC/FAC/backend/node_modules/

- name: Run Cypress full submission test
uses: Wandalen/wretry.action@master
with:
action: cypress-io/github-action@v6
with: |
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js
browser: chrome
attempt_limit: 5
attempt_delay: 2000

- name: Run Cypress Test
uses: cypress-io/github-action@v6
- uses: actions/upload-artifact@v3
# add the line below to store screenshots only on failures
if: failure()
with:
command: npx cypress run
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js
name: cypress-screenshots
path: backend/cypress/screenshots
if-no-files-found: warn # 'warn' or 'error' are also available, defaults to `warn`
51 changes: 42 additions & 9 deletions .github/workflows/testing-from-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,23 @@ jobs:
npm run test:a11y:lighthouse
npm run test:a11y:pa11y
regression-tests:
regression-testing:
runs-on: ubuntu-latest
environment: dev
env:
# Container Related ENV
ENV: TESTING
SAM_API_KEY: ${{ secrets.SAM_API_KEY }}
DJANGO_BASE_URL: 'http://localhost:8000'
DJANGO_SECRET_LOGIN_KEY: ${{ secrets.DJANGO_SECRET_LOGIN_KEY }}
LOGIN_CLIENT_ID: ${{ secrets.LOGIN_CLIENT_ID }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ALLOWED_HOSTS: '0.0.0.0 127.0.0.1 localhost'
PGRST_JWT_SECRET: ${{ secrets.PGRST_JWT_SECRET }}
# Cypress Related ENV
CYPRESS_API_GOV_KEY: ${{ secrets.CYPRESS_API_GOV_KEY }}
CYPRESS_API_GOV_URL: ${{ secrets.CYPRESS_API_GOV_URL }}
CYPRESS_BASE_URL: 'http://localhost:8000'
CYPRESS_BASE_URL: http://localhost:8000'
CYPRESS_LOGIN_TEST_EMAIL: ${{ secrets.CYPRESS_LOGIN_TEST_EMAIL }}
CYPRESS_LOGIN_TEST_PASSWORD: ${{ secrets.CYPRESS_LOGIN_TEST_PASSWORD }}
CYPRESS_LOGIN_TEST_OTP_SECRET: ${{ secrets.CYPRESS_LOGIN_TEST_OTP_SECRET }}
Expand All @@ -107,15 +117,38 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Start services
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Start Services
working-directory: ./backend
run: |
touch .env
docker compose -f docker-compose.yml up -d
docker compose -f docker-compose-web.yml up -d
- name: Install npm dependencies
working-directory: ./backend
run: sudo npm install

- name: Remove node_modules/ so cypress-io/github-action@v6 works
run: sudo rm -rf /home/runner/work/FAC/FAC/backend/node_modules/

- name: Run Cypress full submission test
uses: Wandalen/wretry.action@master
with:
action: cypress-io/github-action@v6
with: |
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js
browser: chrome
attempt_limit: 5
attempt_delay: 2000

- name: Run Cypress Test
uses: cypress-io/github-action@v6
- uses: actions/upload-artifact@v3
# add the line below to store screenshots only on failures
if: failure()
with:
command: npx cypress run
working-directory: ./backend
spec: cypress/e2e/full-submission.cy.js
name: cypress-screenshots
path: backend/cypress/screenshots
if-no-files-found: warn # 'warn' or 'error' are also available, defaults to `warn`

0 comments on commit 25e5772

Please sign in to comment.