Skip to content

Scheduled UW IdP Test Matrix #594

Scheduled UW IdP Test Matrix

Scheduled UW IdP Test Matrix #594

name: No Slack - Scheduled UW IdP Test Matrix
on:
push:
branches:
# You can test this workflow by pushing to this branch
- run-scheduled-idp-web-tests
schedule:
# The cron string must be quoted!
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule
# Do not change this without also changing stop-test-service-providers.yml
- cron: '0 10 * * *' # 3am PDT, 2am PST
workflow_dispatch:
inputs:
target-idp-env:
description: >
NOTE: Running this workflows manually via this form will allow you to test the yaml of this workflow file and it will run the same tests as found in "No Slack - Run UW IdP Web Tests."
For "normal" on demand running of the idp tests, the "No Slack - Run UW IdP Web Tests" can be used.
target-idp-env. Acceptable values are `eval`, `prod`. The idp environment
you want to test against.
required: true
default: eval
target-idp-host:
description: >
target-idp-host. Optional. If provided, will add an /etc/hosts entry
targeting this host.
required: false
reason:
description: >
reason. The reason for running this test suite; can be helpful to
provide context and distinguish different runs.
required: false
pytest-args:
description: >
pytest-args. Any args you want to send to pytest. You do not ever need to
supply `log_cli` arguments.
required: false
jobs:
run-web-tests:
strategy:
matrix:
include:
- idp_env: eval
- idp_env: prod
fail-fast: false # Don't cancel prod tests if eval fails and vice versa
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
actions: write
env:
ARTIFACT_BUCKET: ${{ secrets.IDENTITY_ARTIFACT_BUCKET }}
steps:
- uses: actions/checkout@v3
- id: config
run: |
set -x
timestamp=$(date "+%Y.%d.%m-%H.%m.%S")
storyboard_path="idp/schedule/${{ matrix.idp_env }}/${timestamp}"
report_dir="web-tests/${storyboard_path}"
echo timestamp=${timestamp} >> $GITHUB_OUTPUT
echo storyboard_path=${storyboard_path} >> $GITHUB_OUTPUT
echo report_dir=${report_dir} >> $GITHUB_OUTPUT
echo storyboard_link=${storyboard_url}/${report_dir}/index.html >> $GITHUB_OUTPUT
echo workflow_link=${{ env.workflow_link }} >> $GITHUB_OUTPUT
env:
storyboard_url: https://identity-artifact.iamdev.s.uw.edu/
workflow_link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- uses: UWIT-IAM/actions/[email protected]
with:
gcloud-token: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }}
- name: Run tests
run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }}
id: run
- name: Determine post-test actions
if: always()
run: |
if test -f webdriver-report/index.html
then
mkdir -pv ${{ steps.config.outputs.report_dir }}
cp -r webdriver-report/* ${{ steps.config.outputs.report_dir }}
echo upload_storyboards='true' >> $GITHUB_OUTPUT
fi
id: post-run
- if: always() && steps.post-run.outputs.upload_storyboards == 'true'
name: Upload storyboards to identity-artifact
id: upload-storyboards
uses: google-github-actions/upload-cloud-storage@v2
with:
path: 'web-tests'
destination: ${{ secrets.IDENTITY_ARTIFACT_BUCKET }}
- if: >
always()
&& steps.post-run.outputs.upload_storyboards =='true'
&& steps.upload-storyboards.outcome == 'success'
name: Set notices on workflow
env:
storyboard_link: ${{ steps.config.outputs.storyboard_link }}
run: echo "::notice::Storyboards located at ${{ env.storyboard_link }}"