From 2e5709128970aa0abbdba1f0f0804e37be049a1b Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 28 May 2024 12:48:37 +1200 Subject: [PATCH 1/3] split yaml file --- .../scheduled_production_cypress.yml | 77 +++++++++++++++++++ ...ress.yml => scheduled_staging_cypress.yml} | 30 +------- 2 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/scheduled_production_cypress.yml rename .github/workflows/{scheduled_cypress.yml => scheduled_staging_cypress.yml} (81%) diff --git a/.github/workflows/scheduled_production_cypress.yml b/.github/workflows/scheduled_production_cypress.yml new file mode 100644 index 00000000..ad6e8721 --- /dev/null +++ b/.github/workflows/scheduled_production_cypress.yml @@ -0,0 +1,77 @@ +name: Scheduled Production Cypress Testing + +on: + schedule: + - cron: "0 0 * * 1" + +env: + PAGE_LIMIT: ${{ github.event.inputs.PAGE_LIMIT }} + SEARCH_KEYWORDS: ${{ github.event.inputs.SEARCH_KEYWORDS }} + FILTER_FACET: ${{ github.event.inputs.FILTER_FACET }} + MULTIPLE_FILTER_FACETS: ${{ github.event.inputs.MULTIPLE_FILTER_FACETS }} + DATASET_IDS: ${{ github.event.inputs.DATASET_IDS }} + TAXON_MODELS: ${{ github.event.inputs.TAXON_MODELS }} + THREE_SYNC_VIEW: ${{ github.event.inputs.THREE_SYNC_VIEW }} + SEARCH_IN_MAP: ${{ github.event.inputs.SEARCH_IN_MAP }} + SCAFFOLD_DATASET_IDS: ${{ github.event.inputs.SCAFFOLD_DATASET_IDS }} + CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} + ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} + ALGOLIA_INDEX: ${{ secrets.ALGOLIA_INDEX }} + AWS_USER_POOL_ID: ${{ secrets.AWS_USER_POOL_ID }} + AWS_USER_POOL_WEB_CLIENT_ID: ${{ secrets.AWS_USER_POOL_WEB_CLIENT_ID }} + BIOLUCIDA_PASSWORD: ${{ secrets.BIOLUCIDA_PASSWORD }} + BIOLUCIDA_USERNAME: ${{ secrets.BIOLUCIDA_USERNAME }} + BITLY_ACCESS_TOKEN: ${{ secrets.BITLY_ACCESS_TOKEN }} + BLACKFYNN_API_SECRET: ${{ secrets.BLACKFYNN_API_SECRET }} + BLACKFYNN_API_TOKEN: ${{ secrets.BLACKFYNN_API_TOKEN }} + BLACKFYNN_CONCEPTS_API_HOST: ${{ secrets.BLACKFYNN_CONCEPTS_API_HOST }} + CTF_API_HOST: ${{ secrets.CTF_API_HOST }} + CTF_CDA_ACCESS_TOKEN: ${{ secrets.CTF_CDA_ACCESS_TOKEN }} + CTF_SPACE_ID: ${{ secrets.CTF_SPACE_ID }} + DEPLOY_ENV: ${{ secrets.DEPLOY_ENV }} + DISABLE_REDIRECT_SSL: ${{ secrets.DISABLE_REDIRECT_SSL }} + FLATMAP_API_HOST: ${{ secrets.FLATMAP_API_HOST }} + LOGIN_API_URL: ${{ secrets.LOGIN_API_URL }} + NODE_ENV: ${{ secrets.NODE_ENV }} + NPM_CONFIG_PRODUCTION: ${{ secrets.NPM_CONFIG_PRODUCTION }} + OSPARC_HOST: ${{ secrets.OSPARC_HOST }} + PORTAL_API_HOST: ${{ secrets.PORTAL_API_HOST }} + RECAPTCHA_SECRET_KEY: ${{ secrets.RECAPTCHA_SECRET_KEY }} + RECAPTCHA_SITE_KEY: ${{ secrets.RECAPTCHA_SITE_KEY }} + SHOW_FUNDING_FACET: ${{ secrets.SHOW_FUNDING_FACET }} + SHOW_HIERARCHAL_FACETS: ${{ secrets.SHOW_HIERARCHAL_FACETS }} + SHOW_LOGIN_FEATURE: ${{ secrets.SHOW_LOGIN_FEATURE }} + SHOW_METRICS: ${{ secrets.SHOW_METRICS }} + SHOW_OSPARC_TAB: ${{ secrets.SHOW_OSPARC_TAB }} + SHOW_TIMESERIES_VIEWER: ${{ secrets.SHOW_TIMESERIES_VIEWER }} + SPARC_PORTAL_USER_ID: ${{ secrets.SPARC_PORTAL_USER_ID }} + SPARC_PORTAL_USER_SECRET: ${{ secrets.SPARC_PORTAL_USER_SECRET }} + +jobs: + scheduled-cypress-run-production: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + containers: [1, 2, 3, 4] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.17.1 + + - name: Schedule Run Testing against Production + uses: cypress-io/github-action@v6 + env: + ROOT_URL: "https://sparc.science" + with: + wait-on: ${{ env.ROOT_URL }} + record: true + parallel: true diff --git a/.github/workflows/scheduled_cypress.yml b/.github/workflows/scheduled_staging_cypress.yml similarity index 81% rename from .github/workflows/scheduled_cypress.yml rename to .github/workflows/scheduled_staging_cypress.yml index f1f33988..5bfc456f 100644 --- a/.github/workflows/scheduled_cypress.yml +++ b/.github/workflows/scheduled_staging_cypress.yml @@ -1,4 +1,4 @@ -name: Scheduled Cypress Testing +name: Scheduled Staging Cypress Testing on: schedule: @@ -51,7 +51,6 @@ env: jobs: scheduled-cypress-run-staging: - if: github.event_name == 'schedule' runs-on: ubuntu-latest strategy: @@ -76,30 +75,3 @@ jobs: wait-on: ${{ env.ROOT_URL }} record: true parallel: true - - scheduled-cypress-run-production: - if: github.event_name == 'schedule' - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - containers: [1, 2, 3, 4] - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 18.17.1 - - - name: Schedule Run Testing against Production - uses: cypress-io/github-action@v6 - env: - ROOT_URL: "https://sparc.science" - with: - wait-on: ${{ env.ROOT_URL }} - record: true - parallel: true From 2ace281f0a018639480f02b29acc10e8ea90fae5 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 28 May 2024 12:49:01 +1200 Subject: [PATCH 2/3] add `tag` --- .github/workflows/pull_request_cypress.yml | 1 + .github/workflows/quality_control_cypress.yml | 2 ++ .github/workflows/scheduled_production_cypress.yml | 1 + .github/workflows/scheduled_staging_cypress.yml | 1 + 4 files changed, 5 insertions(+) diff --git a/.github/workflows/pull_request_cypress.yml b/.github/workflows/pull_request_cypress.yml index 1bbcc428..38893f59 100644 --- a/.github/workflows/pull_request_cypress.yml +++ b/.github/workflows/pull_request_cypress.yml @@ -89,6 +89,7 @@ jobs: wait-on: ${{ secrets.ROOT_URL }} record: true parallel: true + tag: PR - name: Skip tests if: steps.checkUser.outputs.require-result == 'false' diff --git a/.github/workflows/quality_control_cypress.yml b/.github/workflows/quality_control_cypress.yml index 4b6d1005..e0ce72a9 100644 --- a/.github/workflows/quality_control_cypress.yml +++ b/.github/workflows/quality_control_cypress.yml @@ -129,6 +129,7 @@ jobs: record: true parallel: true spec: tests/cypress/e2e/databrowser.cy.js,tests/cypress/e2e/datasets.cy.js,tests/cypress/e2e/mapsviewer.cy.js + tag: QC-${{github.event.inputs.PORTAL_TARGET}} - name: Manual Run Testing against Production if: ${{ github.event.inputs.PORTAL_TARGET == 'Production' }} @@ -140,3 +141,4 @@ jobs: record: true parallel: true spec: tests/cypress/e2e/databrowser.cy.js,tests/cypress/e2e/datasets.cy.js,tests/cypress/e2e/mapsviewer.cy.js + tag: QC-${{github.event.inputs.PORTAL_TARGET}} diff --git a/.github/workflows/scheduled_production_cypress.yml b/.github/workflows/scheduled_production_cypress.yml index ad6e8721..5f86059d 100644 --- a/.github/workflows/scheduled_production_cypress.yml +++ b/.github/workflows/scheduled_production_cypress.yml @@ -75,3 +75,4 @@ jobs: wait-on: ${{ env.ROOT_URL }} record: true parallel: true + tag: Scheduled-Production diff --git a/.github/workflows/scheduled_staging_cypress.yml b/.github/workflows/scheduled_staging_cypress.yml index 5bfc456f..340c18be 100644 --- a/.github/workflows/scheduled_staging_cypress.yml +++ b/.github/workflows/scheduled_staging_cypress.yml @@ -75,3 +75,4 @@ jobs: wait-on: ${{ env.ROOT_URL }} record: true parallel: true + tag: Scheduled-Staging From e8c233ee2ba97db8323c9f56383071538ac4881e Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 28 May 2024 12:53:16 +1200 Subject: [PATCH 3/3] add back run job condition --- .github/workflows/scheduled_production_cypress.yml | 1 + .github/workflows/scheduled_staging_cypress.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/scheduled_production_cypress.yml b/.github/workflows/scheduled_production_cypress.yml index 5f86059d..4141aefd 100644 --- a/.github/workflows/scheduled_production_cypress.yml +++ b/.github/workflows/scheduled_production_cypress.yml @@ -51,6 +51,7 @@ env: jobs: scheduled-cypress-run-production: + if: github.event_name == 'schedule' runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/scheduled_staging_cypress.yml b/.github/workflows/scheduled_staging_cypress.yml index 340c18be..6dc7bde7 100644 --- a/.github/workflows/scheduled_staging_cypress.yml +++ b/.github/workflows/scheduled_staging_cypress.yml @@ -51,6 +51,7 @@ env: jobs: scheduled-cypress-run-staging: + if: github.event_name == 'schedule' runs-on: ubuntu-latest strategy: