From 6f9b8260edfff72ba0b340352162fa9c2891aa57 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:07:08 -0800 Subject: [PATCH 01/20] starting adding Teams notifications to scheduled tests --- .github/workflows/scheduled-idp-web-tests.yml | 96 ++++++++++++++++++- docker-compose.yml | 4 +- 2 files changed, 96 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 87005f5..22db7f4 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -1,4 +1,4 @@ -name: No Slack - Scheduled UW IdP Test Matrix +name: Scheduled UW IdP Test Matrix on: push: @@ -77,6 +77,45 @@ jobs: with: gcloud-token: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }} + - name: Notify Teams of Test Run Start + env: + IDP_ENV: ${{ steps.configure.outputs.idp-env }} + INPUT_REASON: ${{ steps.configure.outputs.input-reason }} + run: | + curl -H "Content-Type: application/json" \ + -d '{ + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.adaptive", + "content": { + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.4", + "body": [ + { + "type": "TextBlock", + "size": "Large", + "weight": "Bolder", + "text": "Starting - IDP Test Run Notification" + }, + { + "type": "TextBlock", + "text": "'"$test_result"'", + "wrap": true + }, + { + "type": "FactSet", + "facts": [ + {"title": "Reason for Test Run", "value": "GlenHardcodedReason"} + ] + } + ] + } + } + ] + }' \ + "${{ secrets.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" - name: Run tests run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} @@ -105,9 +144,62 @@ jobs: - if: > always() - && steps.post-run.outputs.upload_storyboards =='true' + && 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 }}" + + - name: Notify Teams of Test Run Completion + env: + TEST_STATUS: ${{ steps.run-tests.outputs.test-status }} + REPORT_URL: ${{ steps.configure.outputs.report-url }} + INPUT_REASON: ${{ steps.configure.outputs.input-reason }} + IDP_ENV: ${{ steps.configure.outputs.idp-env }} + if: always() + run: | + # Set the message body dynamically based on TEST_STATUS + echo "TEST_STATUS=${{ env.TEST_STATUS }}" + if [ "$TEST_STATUS" = "succeeded" ]; then + test_result="Test run for IDP passed successfully ✅" + else + test_result="Test run for IDP failed ❌" + fi + + # Notify Teams with the status of the test run + curl -H "Content-Type: application/json" \ + -d '{ + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.adaptive", + "content": { + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.4", + "body": [ + { + "type": "TextBlock", + "size": "Large", + "weight": "Bolder", + "text": "Completed - IDP Test Run Notification" + }, + { + "type": "TextBlock", + "text": "'"$test_result"'", + "wrap": true + }, + { + "type": "FactSet", + "facts": [ + {"title": "Reason for Test Run", "value": "GlenHardcodedReason"} + ] + } + ] + } + } + ] + }' \ + "${{ secrets.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" + diff --git a/docker-compose.yml b/docker-compose.yml index cbed1ef..c7fef6e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,8 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 - # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. + # command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: image: selenium/standalone-chrome:4 From 29fa88cf59ae4cd00128a459e85fc585cda9b19a Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 10:40:07 -0800 Subject: [PATCH 02/20] notification text revision --- .github/workflows/scheduled-idp-web-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 22db7f4..1ddcc30 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -97,17 +97,17 @@ jobs: "type": "TextBlock", "size": "Large", "weight": "Bolder", - "text": "Starting - IDP Test Run Notification" + "text": "IDP Test Run Notification" }, { "type": "TextBlock", - "text": "'"$test_result"'", + "text": "Starting - IDP Tests ⏳", "wrap": true }, { "type": "FactSet", "facts": [ - {"title": "Reason for Test Run", "value": "GlenHardcodedReason"} + {"title": "Reason for Test Run", "value": "GlenHardcodedReasonStart"} ] } ] From ff1d44a6d8390581a5c9a065d456d35ebd693318 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:36:34 -0800 Subject: [PATCH 03/20] fix env variables --- .github/workflows/scheduled-idp-web-tests.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 1ddcc30..0f13568 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -40,6 +40,14 @@ on: supply `log_cli` arguments. required: false +env: + ############################################### + # Do not edit the env values below this line. # + # Other defaults are set in .github/scripts/configure-workflow.sh + TEAMS_INTEGRATIONS_DAILY_WEB_TESTS: ${{ secrets.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }} + ARTIFACT_BUCKET: ${{ secrets.IDENTITY_ARTIFACT_BUCKET }} + ############################################### + jobs: run-web-tests: strategy: @@ -115,7 +123,7 @@ jobs: } ] }' \ - "${{ secrets.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" + "${{ env.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" - name: Run tests run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} From 31a3f80b2dc1b46d92e7a3ba0ba03fcd61fa305f Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 11:43:14 -0800 Subject: [PATCH 04/20] include what env the tests are running on --- .github/workflows/scheduled-idp-web-tests.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 0f13568..fc36835 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -79,7 +79,13 @@ jobs: env: storyboard_url: https://identity-artifact.iamdev.s.uw.edu/ workflow_link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} + outputs: + idp-env: ${{ steps.configure.outputs.idp-env }} + - id: configure + run: echo configuring="configuring" >> $GITHUB_OUTPUT + env: + INPUT_TARGET_IDP_ENV: ${{ matrix.idp_env }} - uses: UWIT-IAM/actions/configure-gcloud-docker-gcloud-v101@0.1.17 with: @@ -87,8 +93,8 @@ jobs: - name: Notify Teams of Test Run Start env: - IDP_ENV: ${{ steps.configure.outputs.idp-env }} - INPUT_REASON: ${{ steps.configure.outputs.input-reason }} + IDP_ENV: ${{ env.INPUT_TARGET_IDP_ENV }} + INPUT_REASON: ${{ steps.config.outputs.input-reason }} run: | curl -H "Content-Type: application/json" \ -d '{ @@ -115,6 +121,7 @@ jobs: { "type": "FactSet", "facts": [ + {"title": "IdP Web Tests running on ", "value": "'${{ env.IDP_ENV }}'"}, {"title": "Reason for Test Run", "value": "GlenHardcodedReasonStart"} ] } @@ -162,9 +169,9 @@ jobs: - name: Notify Teams of Test Run Completion env: TEST_STATUS: ${{ steps.run-tests.outputs.test-status }} - REPORT_URL: ${{ steps.configure.outputs.report-url }} - INPUT_REASON: ${{ steps.configure.outputs.input-reason }} - IDP_ENV: ${{ steps.configure.outputs.idp-env }} + REPORT_URL: ${{ steps.config.outputs.report-url }} + INPUT_REASON: ${{ steps.config.outputs.input-reason }} + IDP_ENV: ${{ env.idp_env }} if: always() run: | # Set the message body dynamically based on TEST_STATUS @@ -201,6 +208,7 @@ jobs: { "type": "FactSet", "facts": [ + {"title": "IdP Web Tests ran on ", "value": "'${{ env.IDP_ENV }}'"}, {"title": "Reason for Test Run", "value": "GlenHardcodedReason"} ] } From 543e1ac0b4065a4dd031592bf2fe4daa1107cd7f Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:17:56 -0800 Subject: [PATCH 05/20] fixing idp env --- .github/workflows/scheduled-idp-web-tests.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index fc36835..613b2f7 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -79,13 +79,6 @@ jobs: env: storyboard_url: https://identity-artifact.iamdev.s.uw.edu/ workflow_link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} - outputs: - idp-env: ${{ steps.configure.outputs.idp-env }} - - - id: configure - run: echo configuring="configuring" >> $GITHUB_OUTPUT - env: - INPUT_TARGET_IDP_ENV: ${{ matrix.idp_env }} - uses: UWIT-IAM/actions/configure-gcloud-docker-gcloud-v101@0.1.17 with: @@ -93,7 +86,7 @@ jobs: - name: Notify Teams of Test Run Start env: - IDP_ENV: ${{ env.INPUT_TARGET_IDP_ENV }} + IDP_ENV: ${{ matrix.idp_env }} INPUT_REASON: ${{ steps.config.outputs.input-reason }} run: | curl -H "Content-Type: application/json" \ From 290477c951481fce2f40ae0028d5cdfce3604adf Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:52:07 -0800 Subject: [PATCH 06/20] fix the test result ipd env, test start and end reason --- .github/scripts/configure-workflow.sh | 2 ++ .github/workflows/scheduled-idp-web-tests.yml | 22 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/scripts/configure-workflow.sh b/.github/scripts/configure-workflow.sh index e85c7f9..b57bb7b 100644 --- a/.github/scripts/configure-workflow.sh +++ b/.github/scripts/configure-workflow.sh @@ -112,6 +112,8 @@ function get-input-reason() { REASON="$INPUT_REASON" elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then REASON="Triggered from PR" + elif [ "$GITHUB_EVENT_NAME" = "schedule" ]; then + REASON="Scheduled run" else REASON="No reason provided" fi diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 613b2f7..17a64a0 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -84,10 +84,22 @@ jobs: with: gcloud-token: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }} + - id: configure + env: + # INPUT_TARGET_IDP_ENV: ${{ github.event.inputs.target-idp-env }} + # INPUT_TARGET_IDP_HOST: ${{ github.event.inputs.target-idp-host }} + INPUT_REASON: ${{ github.event.inputs.reason }} + # INPUT_PYTEST_ARGS: ${{ github.event.inputs.pytest-args }} + # UWCA_CERT: ${{ secrets.UWCA_CERT }} + # UWCA_KEY: ${{ secrets.UWCA_KEY }} + run: | + source ./.github/scripts/configure-workflow.sh + configure-workflow + - name: Notify Teams of Test Run Start env: IDP_ENV: ${{ matrix.idp_env }} - INPUT_REASON: ${{ steps.config.outputs.input-reason }} + INPUT_REASON: ${{ steps.configure.outputs.input-reason }} run: | curl -H "Content-Type: application/json" \ -d '{ @@ -115,7 +127,7 @@ jobs: "type": "FactSet", "facts": [ {"title": "IdP Web Tests running on ", "value": "'${{ env.IDP_ENV }}'"}, - {"title": "Reason for Test Run", "value": "GlenHardcodedReasonStart"} + {"title": "Reason for Test Run", "value": "${{ env.INPUT_REASON }}"} ] } ] @@ -163,8 +175,8 @@ jobs: env: TEST_STATUS: ${{ steps.run-tests.outputs.test-status }} REPORT_URL: ${{ steps.config.outputs.report-url }} - INPUT_REASON: ${{ steps.config.outputs.input-reason }} - IDP_ENV: ${{ env.idp_env }} + INPUT_REASON: ${{ steps.configure.outputs.input-reason }} + IDP_ENV: ${{ matrix.idp_env }} if: always() run: | # Set the message body dynamically based on TEST_STATUS @@ -202,7 +214,7 @@ jobs: "type": "FactSet", "facts": [ {"title": "IdP Web Tests ran on ", "value": "'${{ env.IDP_ENV }}'"}, - {"title": "Reason for Test Run", "value": "GlenHardcodedReason"} + {"title": "Reason for Test Run", "value": "${{ env.INPUT_REASON }}"} ] } ] From fdde8aa0de5edc6a3e1ca3c37ab5ec3653058374 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Wed, 15 Jan 2025 15:11:30 -0800 Subject: [PATCH 07/20] getting the test result --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index c7fef6e..cbed1ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,8 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - # command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 - command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. + command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: image: selenium/standalone-chrome:4 From 29265e1b7b07a222526ae83b2a5fd76a9fef049d Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:56:34 -0800 Subject: [PATCH 08/20] fix commands that run the tests --- .github/workflows/scheduled-idp-web-tests.yml | 2 +- docker-compose.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 17a64a0..1ddbbdf 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -139,7 +139,7 @@ jobs: - name: Run tests run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} - id: run + id: run-tests - name: Determine post-test actions if: always() diff --git a/docker-compose.yml b/docker-compose.yml index cbed1ef..4386710 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,8 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + command: pytest -- tests/test_2fa_duo.py::test_remember_me_cookie --selenium-server selenium:4444 + # command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: From f98c9aa46472777926217345ed4576a2c6ae5d62 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:02:12 -0800 Subject: [PATCH 09/20] fix commands that run the tests --- docker-compose.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4386710..cbed1ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,7 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - command: pytest -- tests/test_2fa_duo.py::test_remember_me_cookie --selenium-server selenium:4444 - # command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: From 676f4eb5b7db6d67b36dcf7849960e5fa7289f21 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:49:12 -0800 Subject: [PATCH 10/20] add more commands for getting test status --- .github/workflows/scheduled-idp-web-tests.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 1ddbbdf..bc4b178 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -137,9 +137,22 @@ jobs: }' \ "${{ env.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" + # - name: Run tests + # run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} + # id: run-tests + - name: Run tests - run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} - id: run-tests + run: | + exit_status=0 + if ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} + then + echo "All tests succeeded for ${{ env.IDP_ENV }} succeeded! " + test_status=succeeded + else + exit_status=$? + echo "Tests for ${{ env.IDP_ENV }} failed with status $exit_status" + test_status=failed + fi - name: Determine post-test actions if: always() From 2e598e95fb63aa1e43782f99e33eb2246f4db2d0 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:39:28 -0800 Subject: [PATCH 11/20] more test status adjustments --- .github/workflows/scheduled-idp-web-tests.yml | 8 ++++++-- docker-compose.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index bc4b178..c39da57 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -146,14 +146,18 @@ jobs: exit_status=0 if ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} then - echo "All tests succeeded for ${{ env.IDP_ENV }} succeeded! " + echo "All tests succeeded for ${{ matrix.idp_env }}! " test_status=succeeded else exit_status=$? - echo "Tests for ${{ env.IDP_ENV }} failed with status $exit_status" + echo "Tests for ${{ matrix.idp_env }} failed with status $exit_status" test_status=failed fi + echo "test-status=$test_status" >> $GITHUB_OUTPUT + echo "upload-artifacts=true" >> $GITHUB_OUTPUT + exit $exit_status + - name: Determine post-test actions if: always() run: | diff --git a/docker-compose.yml b/docker-compose.yml index cbed1ef..1e7be72 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,7 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 tests/test_2fa_duo.py::test_remember_me_cookie # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: From c212a3305da423c70d7753d6bc26809c02043d42 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:53:27 -0800 Subject: [PATCH 12/20] more test status adjustments --- .github/workflows/scheduled-idp-web-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index c39da57..d812a08 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -142,6 +142,7 @@ jobs: # id: run-tests - name: Run tests + id: run-tests run: | exit_status=0 if ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} From 7d2ff0f3c9936990e5b170d959a10bc92a95daaf Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:17:38 -0800 Subject: [PATCH 13/20] invoke a test fail to test a fail status message --- tests/test_2fa_duo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_2fa_duo.py b/tests/test_2fa_duo.py index 233682b..a61f9e4 100644 --- a/tests/test_2fa_duo.py +++ b/tests/test_2fa_duo.py @@ -196,7 +196,7 @@ def test_remember_me_cookie( Select the other duo option, to get to the bypass code option """ wait = WebDriverWait(fresh_browser, 10) - wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(), 'Other options')]"))) + wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(), 'Otheeeeeer options')]"))) enter_duo_passcode(fresh_browser, match_service_provider=sp, select_this_is_my_device=True) # go to an idp site to retrieve the shib idp cookies From 550232c83d76383e9da3dc713bb36fe72a440faf Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:43:17 -0800 Subject: [PATCH 14/20] create new function for test_status dependencies --- .github/scripts/configure-workflow.sh | 7 +++++++ .github/workflows/scheduled-idp-web-tests.yml | 5 ++++- tests/test_2fa_duo.py | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/scripts/configure-workflow.sh b/.github/scripts/configure-workflow.sh index b57bb7b..0895a39 100644 --- a/.github/scripts/configure-workflow.sh +++ b/.github/scripts/configure-workflow.sh @@ -137,3 +137,10 @@ function configure-workflow() { set-output run-tests-args "$(get-run-tests-args $artifact_object_path)" set-output input-reason "$(get-input-reason)" } + +function configure-workflow-scheduled() { + local event_name="$GITHUB_EVENT_NAME" + local artifact_object_path=$(get-report-output-path $event_name) + INPUT_TARGET_IDP_ENV="${INPUT_TARGET_IDP_ENV:-eval}" + set-output report-url "$ARTIFACT_DOMAIN/$artifact_object_path/index.html" +} diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index d812a08..5ef9770 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -76,6 +76,8 @@ jobs: 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 + source ./.github/scripts/configure-workflow.sh + configure-workflow-scheduled env: storyboard_url: https://identity-artifact.iamdev.s.uw.edu/ workflow_link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -232,7 +234,8 @@ jobs: "type": "FactSet", "facts": [ {"title": "IdP Web Tests ran on ", "value": "'${{ env.IDP_ENV }}'"}, - {"title": "Reason for Test Run", "value": "${{ env.INPUT_REASON }}"} + {"title": "Reason for Test Run", "value": "${{ env.INPUT_REASON }}"}, + {"title": "Storyboards:", "value": "['"$REPORT_URL"']('"$REPORT_URL"')"} ] } ] diff --git a/tests/test_2fa_duo.py b/tests/test_2fa_duo.py index a61f9e4..233682b 100644 --- a/tests/test_2fa_duo.py +++ b/tests/test_2fa_duo.py @@ -196,7 +196,7 @@ def test_remember_me_cookie( Select the other duo option, to get to the bypass code option """ wait = WebDriverWait(fresh_browser, 10) - wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(), 'Otheeeeeer options')]"))) + wait.until(EC.element_to_be_clickable((By.XPATH, "//a[contains(text(), 'Other options')]"))) enter_duo_passcode(fresh_browser, match_service_provider=sp, select_this_is_my_device=True) # go to an idp site to retrieve the shib idp cookies From 356abd98a9a4658be0243ac10f0e62d8f27becf1 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:10:09 -0800 Subject: [PATCH 15/20] change report_url value --- .github/workflows/scheduled-idp-web-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 5ef9770..dd3c691 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -194,7 +194,7 @@ jobs: - name: Notify Teams of Test Run Completion env: TEST_STATUS: ${{ steps.run-tests.outputs.test-status }} - REPORT_URL: ${{ steps.config.outputs.report-url }} + REPORT_URL: ${{ steps.config.outputs.storyboard_link }} INPUT_REASON: ${{ steps.configure.outputs.input-reason }} IDP_ENV: ${{ matrix.idp_env }} if: always() From 98d56ce67a37d5c8d29ec5aaf174518043b2ab12 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:10:42 -0800 Subject: [PATCH 16/20] remove most of the workflow form --- .github/workflows/scheduled-idp-web-tests.yml | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index dd3c691..8bd8d42 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -12,32 +12,10 @@ on: - 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. + The reason for running this test suite; can be helpful to + provide context and distinguish different runs. **Note, this form only really exists to a dev can test the workflow.** The standard way of running test on demand is with the "Run UW IdP Web Tests" workflow. required: false env: From 3f5d17fe3cca774b99f0ea490ec89cab1474dfd2 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Thu, 16 Jan 2025 15:31:19 -0800 Subject: [PATCH 17/20] Add guidance for debugging workflow --- docker-compose.yml | 3 ++- docs/github-actions.md | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1e7be72..6386017 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,8 @@ services: volumes: - ${CREDENTIAL_MOUNT_POINT}:/secrets:ro - ${REPORT_MOUNT_POINT}:/tmp/webdriver-report - command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 tests/test_2fa_duo.py::test_remember_me_cookie + command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 + # command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 tests/test_2fa_duo.py::test_remember_me_cookie #If you want to run one more specific tests, use this command instead of the above. # command: echo "The test would start here" #If you don't want the tests to run, and test other things like notifications, use this command instead of the above. selenium: diff --git a/docs/github-actions.md b/docs/github-actions.md index 558e4f1..f5efdb7 100644 --- a/docs/github-actions.md +++ b/docs/github-actions.md @@ -95,6 +95,10 @@ Remove the line `command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444` You can replace to with `command: echo "The test would start here"`. That will not run the tests and instead, it will put an entry in the logs/terminal that says "The test would start here". You'll still see the test run and end notifications but the tests won't run. +You can also run a specific test with this command: +`command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 path/to/testfile` or +`command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 path/to/testfile::` +`command: pytest ${PYTEST_ARGS} --selenium-server selenium:4444 tests/test_2fa_duo.py::test_remember_me_cookie` [test workflow]: https://github.com/UWIT-IAM/uw-idp-web-tests/actions/workflows/automated-idp-web-tests.yml [Github Actions UI]: https://github.com/uwit-iam/uw-idp-web-tests/actions From f29681da88f30d7a9982e93d516ebe56cb49e9bc Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:26:36 -0800 Subject: [PATCH 18/20] remove unused code and add some small edits --- .github/workflows/scheduled-idp-web-tests.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/scheduled-idp-web-tests.yml b/.github/workflows/scheduled-idp-web-tests.yml index 8bd8d42..1ef2c0f 100644 --- a/.github/workflows/scheduled-idp-web-tests.yml +++ b/.github/workflows/scheduled-idp-web-tests.yml @@ -54,8 +54,7 @@ jobs: 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 - source ./.github/scripts/configure-workflow.sh - configure-workflow-scheduled + env: storyboard_url: https://identity-artifact.iamdev.s.uw.edu/ workflow_link: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} @@ -66,12 +65,7 @@ jobs: - id: configure env: - # INPUT_TARGET_IDP_ENV: ${{ github.event.inputs.target-idp-env }} - # INPUT_TARGET_IDP_HOST: ${{ github.event.inputs.target-idp-host }} INPUT_REASON: ${{ github.event.inputs.reason }} - # INPUT_PYTEST_ARGS: ${{ github.event.inputs.pytest-args }} - # UWCA_CERT: ${{ secrets.UWCA_CERT }} - # UWCA_KEY: ${{ secrets.UWCA_KEY }} run: | source ./.github/scripts/configure-workflow.sh configure-workflow @@ -96,7 +90,7 @@ jobs: "type": "TextBlock", "size": "Large", "weight": "Bolder", - "text": "IDP Test Run Notification" + "text": "Scheduled UW IdP Test Matrix Run" }, { "type": "TextBlock", @@ -117,9 +111,6 @@ jobs: }' \ "${{ env.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" - # - name: Run tests - # run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} - # id: run-tests - name: Run tests id: run-tests @@ -201,7 +192,7 @@ jobs: "type": "TextBlock", "size": "Large", "weight": "Bolder", - "text": "Completed - IDP Test Run Notification" + "text": "Completed - Scheduled UW IdP Test Matrix Run" }, { "type": "TextBlock", From 043188800c9629415a6baca37dccf37c70aa19c1 Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:00:11 -0800 Subject: [PATCH 19/20] remove old workflows with slack, sadly --- .../workflows/old-automated-idp-web-tests.yml | 248 ------------------ .../workflows/old-scheduled-idp-web-tests.yml | 156 ----------- 2 files changed, 404 deletions(-) delete mode 100644 .github/workflows/old-automated-idp-web-tests.yml delete mode 100644 .github/workflows/old-scheduled-idp-web-tests.yml diff --git a/.github/workflows/old-automated-idp-web-tests.yml b/.github/workflows/old-automated-idp-web-tests.yml deleted file mode 100644 index eac5fce..0000000 --- a/.github/workflows/old-automated-idp-web-tests.yml +++ /dev/null @@ -1,248 +0,0 @@ -name: Slack - Run UW IdP Web Tests - -on: - push: - branches: - # This branch override is meant to act as a way of validating - # the workflow itself, which is difficult to do well out - # of context. Feel free to push to this branch at any time. - # You may need to use `-f` when pushing. - - run-uw-idp-web-tests - pull_request: - paths-ignore: - - "*.md" # No reason to run tests when only docs change - workflow_dispatch: - inputs: - target-idp-env: - description: > - 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 - - slack-channel: - description: > - slack-channel. The channel to send a notification to, detailing the - context and outcome of the test. (`/invite @iam-github-slack-crier` - in the channel, if not already done.) - required: true - default: '#iam-bot-sandbox' - - 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 - - -env: - ############################################### - # Do not edit the env values below this line. # - # Other defaults are set in .github/scripts/configure-workflow.sh - SLACK_BOT_TOKEN: ${{ secrets.ACTIONS_SLACK_BOT_TOKEN }} - ARTIFACT_BUCKET: ${{ secrets.IDENTITY_ARTIFACT_BUCKET }} - ############################################### - -jobs: - run-idp-web-tests: - name: Configure and run tests, and upload test artifacts - runs-on: ubuntu-latest - env: - UPLOAD_STATUS: 'not started' - ARTIFACT_HOST: "https://identity-artifact.iamdev.s.uw.edu" - outputs: - slack-channel: ${{ steps.configure.outputs.slack-channel }} - # These outputs come from the configure-workflow.sh script - report-object-path: ${{ steps.configure.outputs.report-object-path }} - report-url: ${{ steps.configure.outputs.report-url }} - short-sha: ${{ steps.configure.outputs.short-sha }} - pr-number: ${{ steps.configure.outputs.pr-number }} - workflow-id: ${{ steps.configure.outputs.workflow-id }} - workflow-snapshot-artifact: ${{ steps.configure.outputs.workflow-snapshot-artifact }} - idp-env: ${{ steps.configure.outputs.idp-env }} - idp-host: ${{ steps.configure.outputs.idp-host }} - run-tests-args: ${{ steps.configure.outputs.run-tests-args }} - - permissions: - contents: 'read' - id-token: 'write' - pull-requests: 'write' - - steps: - - uses: actions/checkout@main - - - id: configure - env: - INPUT_TARGET_IDP_ENV: ${{ github.event.inputs.target-idp-env }} - INPUT_TARGET_IDP_HOST: ${{ github.event.inputs.target-idp-host }} - INPUT_REASON: ${{ github.event.inputs.reason }} - # INPUT_SLACK_CHANNEL: ${{ github.event.inputs.slack-channel }} - INPUT_PYTEST_ARGS: ${{ github.event.inputs.pytest-args }} - UWCA_CERT: ${{ secrets.UWCA_CERT }} - UWCA_KEY: ${{ secrets.UWCA_KEY }} - run: | - source ./.github/scripts/configure-workflow.sh - configure-workflow - - # - id: set-envs - # run: | - # echo "SLACK_CANVAS_ID=${{ steps.configure.outputs.workflow-id }}" >> $GITHUB_ENV - - - id: 'auth' - name: 'Authenticate to Google Cloud' - uses: 'google-github-actions/auth@v2' - with: - credentials_json: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }} - - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v2' - with: - version: '>= 363.0.0' - - # - name: Initialize slack workflow canvas - # env: - # IDP_ENV: ${{ steps.configure.outputs.idp-env }} - # with: - # command: create-canvas - # # Since your IDE may not pick up on this as JSON and help you, - # # always make sure to run this through a JSON validator. - # json: > - # { - # "channel": "${{ steps.configure.outputs.slack-channel }}", - # "canvasId": "${{ steps.configure.outputs.workflow-id }}", - # "status": "in progress", - # "description": "${{ env.IDP_ENV }} IdP Web Tests", - # "steps": [ - # { - # "description": "Configure workflow", - # "status": "succeeded", - # "stepId": "configure-workflow" - # }, - # { - # "description": "Run UW IdP tests", - # "stepId": "run-tests", - # "status": "in progress" - # }, - # { - # "description": "Upload test artifacts", - # "stepId": "upload-artifacts" - # } - # ] - # } - # channel: ${{ steps.configure.outputs.slack-channel }} - # description: ${{ env.IDP_ENV }} IdP Web Tests - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - # - name: add change information to slack canvas - # with: - # command: add-artifact - # description: ${{ steps.configure.outputs.workflow-snapshot-artifact }} - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - - env: - RUN_TESTS_ARGS: ${{ steps.configure.outputs.run-tests-args }} - IDP_ENV: ${{ steps.configure.outputs.idp-env }} - - run: | - exit_status=0 - if ./scripts/run-tests.sh ${{ steps.args.outputs.extra }} ${{ env.RUN_TESTS_ARGS }} - then - echo "All tests succeeded for ${{ env.IDP_ENV }} succeeded! " - test_status=succeeded - else - exit_status=$? - echo "Tests for ${{ env.IDP_ENV }} failed with status $exit_status" - test_status=failed - fi - - # Only upload artifacts if the test suite actually ran. - echo "test-status=$test_status" >> $GITHUB_OUTPUT - echo "upload-artifacts=true" >> $GITHUB_OUTPUT - exit $exit_status - - name: Run UW ${{ env.IDP_ENV }} IdP Web Tests - id: run-tests - - # - if: always() - # env: - # upload_step_status: > - # ${{ steps.run-tests.outputs.upload-artifacts == 'true' && 'in progress' || 'not started' }} - # test_status: ${{ steps.run-tests.outputs.test-status }} - # with: - # command: update-workflow - # step-id: run-tests, upload-artifacts - # step-status: ${{ env.test_status }}, ${{ env.upload_step_status }} - # workflow-status: ${{ env.test_status == 'succeeded' && 'in progress' || 'failed' }} - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - - if: ${{ always() && steps.run-tests.outputs.upload-artifacts == 'true' }} - id: upload-artifacts - with: - path: web-tests - destination: ${{ secrets.IDENTITY_ARTIFACT_BUCKET }} - name: upload storyboards to identity-artifacts - uses: google-github-actions/upload-cloud-storage@v2 - - # - if: ${{ always() && steps.run-tests.outputs.upload-artifacts == 'true' }} - # with: - # command: update-workflow - # step-id: upload-artifacts - # step-status: > - # ${{ steps.upload-artifacts.conclusion == 'success' && 'succeeded' || 'failed' }} - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - # - if: ${{ always() && steps.run-tests.outputs.upload-artifacts == 'true' }} - # with: - # command: add-artifact - # description: > - # *Storyboards*: ${{ steps.configure.outputs.report-url }} - # name: add storyboard link to slack canvas - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - # - if: always() - # with: - # command: update-workflow - # workflow-status: ${{ steps.run-tests.conclusion == 'success' && 'succeeded' || 'failed' }} - # name: Update workflow status - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - # - if: always() - # with: - # command: remove-step - # step-id: '*' - # step-status: succeeded - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - # - if: always() - # with: - # command: finalize-workflow - # name: clean up slack canvas metadata - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@main - - - if: ${{ always() && github.event_name == 'pull_request' }} - id: update-pull-request - uses: mshick/add-pr-comment@v1 - name: Add storyboard link to pull request - env: - REPORT_URL: ${{ steps.configure.outputs.report-url }} - SHORT_SHA: ${{ steps.configure.outputs.short-sha }} - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - repo-token-user-login: 'github-actions[bot]' # Don't change - allow-repeats: true - message: | - - Test result: ${{ steps.run-tests.outcome }} - - [Storyboards](${{ env.REPORT_URL }}) - **Commit ${{ env.SHORT_SHA }}** diff --git a/.github/workflows/old-scheduled-idp-web-tests.yml b/.github/workflows/old-scheduled-idp-web-tests.yml deleted file mode 100644 index c9f58a8..0000000 --- a/.github/workflows/old-scheduled-idp-web-tests.yml +++ /dev/null @@ -1,156 +0,0 @@ -name: 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 - -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: - # SLACK_BOT_TOKEN: ${{ secrets.ACTIONS_SLACK_BOT_TOKEN }} - 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/configure-gcloud-docker-gcloud-v101@0.1.17 - with: - gcloud-token: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }} - - - # - name: Initialize slack workflow canvas - # env: - # IDP_ENV: ${{ steps.configure.outputs.idp-env }} - # with: - # json: > - # { - # "channel": "#iam-bots", - # "status": "in progress", - # "description": "Scheduled ${{ matrix.idp_env }} IdP Web Tests", - # "steps": [ - # { - # "description": "Run tests", - # "stepId": "run-tests", - # "status": "in progress" - # }, - # { - # "description": "Upload test artifacts", - # "stepId": "upload-artifacts" - # } - # ] - # } - # uses: UWIT-IAM/actions/set-up-slack-notification-canvas@0.1 - # id: slack - - # - if: steps.slack.outputs.canvas-id - # name: Add workflow link to slack notification - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1 - # with: - # command: add-artifact - # description: "<${{ env.workflow_link }} | View Workflow>" - # env: - # workflow_link: ${{ steps.config.outputs.workflow_link }} - - - - 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.slack.outputs.canvas-id - # env: - # run_status: ${{ steps.run.outcome == 'success' && 'succeeded' || 'failed' }} - # upload_status: ${{ steps.post-run.outputs.upload_storyboards == 'true' && 'in progress' || 'failed'}} - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1 - # with: - # step-id: run-tests, upload-artifacts - # step-status: ${{ env.run_status }}, ${{ env.upload_status }} - # command: update-workflow - - - 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' - # && steps.slack.outputs.canvas-id - # name: Add storyboard link to slack notification - # id: add-storyboard-link-to-slack - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1 - # with: - # command: add-artifact - # description: "<${{ steps.config.outputs.storyboard_link }} | View Storyboards>" - - - 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 }}" - - # - if: > - # always() - # && steps.post-run.outputs.upload_storyboards == 'true' - # uses: UWIT-IAM/actions/update-slack-workflow-canvas@0.1 - # env: - # step_status: ${{ steps.upload-storyboards.outcome == 'success' && 'succeeded' || 'failed' }} - # with: - # command: update-workflow - # step-id: upload-artifacts - # step-status: ${{ env.step_status }} - - # - if: always() && steps.slack.outputs.canvas-id - # uses: UWIT-IAM/actions/finalize-slack-notification-canvas@0.1 - # with: - # workflow-status: ${{ job.status == 'success' && 'succeeded' || 'failed' }} From 975e80df0f5c3adfa44d854806de65988c5d923b Mon Sep 17 00:00:00 2001 From: Glen Goulter <37945000+goulter@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:08:30 -0800 Subject: [PATCH 20/20] remove unused, new functon --- .github/scripts/configure-workflow.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/scripts/configure-workflow.sh b/.github/scripts/configure-workflow.sh index 0895a39..b570040 100644 --- a/.github/scripts/configure-workflow.sh +++ b/.github/scripts/configure-workflow.sh @@ -138,9 +138,3 @@ function configure-workflow() { set-output input-reason "$(get-input-reason)" } -function configure-workflow-scheduled() { - local event_name="$GITHUB_EVENT_NAME" - local artifact_object_path=$(get-report-output-path $event_name) - INPUT_TARGET_IDP_ENV="${INPUT_TARGET_IDP_ENV:-eval}" - set-output report-url "$ARTIFACT_DOMAIN/$artifact_object_path/index.html" -}