[FIX] - don't produce random credential id in method #1016
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CORE WEB - Cypress Tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- services/common/** | |
- services/core-web/** | |
- services/core-api/** | |
- services/document-manager/** | |
jobs: | |
run-cypress: | |
name: run-cypress | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
name: checkout | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Install oc | |
uses: redhat-actions/openshift-tools-installer@v1 | |
with: | |
oc: "4.7" | |
- name: oc login | |
run: | | |
oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }} | |
- name: Set up env variables | |
run: | | |
INPUT=yes LOAD_EXTERNAL=yes make env | |
# Run app in production mode | |
sed -i "s/NODE_ENV=.*/NODE_ENV=production/g" ./services/core-web/.env | |
- name: Run keycloak | |
run: | | |
make keycloak | |
- name: Install Dependencies | |
run: | | |
yarn | |
- name: Run app | |
run: | | |
ARTIFACTORY_TOKEN=${{ secrets.ARTIFACTORY_TOKEN }} EXTRA_SERVICES=frontend make be-minimal | |
- name: Seed database | |
run: | | |
make ENTRIES=10 seeddb | |
- name: Run cypress tests | |
run: yarn workspace @mds/core-web cypress run | |
env: | |
CYPRESS_TEST_USER: core-admin | |
CYPRESS_TEST_PASSWORD: cypress | |
CYPRESS_CORE_WEB_TEST_URL: http://localhost:3000 | |
CYPRESS_BACKEND: mds-python-backend | |
CYPRESS_API_URL: http://localhost:5000 | |
CYPRESS_KEYCLOAK_URL: http://localhost:8080/auth | |
CYPRESS_ENVIRONMENT: local | |
CYPRESS_DOC_MAN_URL: http://localhost:5001 | |
CYPRESS_MATOMO_URL: https://matomo-4c2ba9-test.apps.silver.devops.gov.bc.ca/ | |
CYPRESS_KEYCLOAK_CLIENT_ID: mines-digital-services-mds-public-client-4414 | |
CYPRESS_KEYCLOAK_RESOURCE: mines-digital-services-mds-public-client-4414 | |
CYPRESS_KEYCLOAK_IDP_HINT: idir | |
CYPRESS_FILE_SYSTEM_PROVIDER_URL: https://mds-dev.apps.silver.devops.gov.bc.ca/file-api/AmazonS3Provider/ | |
CYPRESS_FLAGSMITH_URL: https://mds-flags-dev.apps.silver.devops.gov.bc.ca/api/v1/ | |
CYPRESS_FLAGSMITH_KEY: 4Eu9eEMDmWVEHKDaKoeWY7 | |
- name: Upload cypress video | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: cypress-recording | |
path: services/core-web/cypress/videos | |
- name: Collect docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 | |
with: | |
dest: "./logs" | |
- name: Tar logs | |
if: failure() | |
run: tar cvzf ./logs.tgz ./logs | |
- name: Upload logs to GitHub | |
if: failure() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: logs.tgz | |
path: ./logs.tgz |