purge sanity tests after run (#3433)
#### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🤖 Supportability/Tests #### Issue(s) * #3431 #### Test Plan - [x] 💚 E2E
This commit is contained in:
parent
e64f93a7d3
commit
ff6334131a
54
.github/workflows/sanity-test.yaml
vendored
54
.github/workflows/sanity-test.yaml
vendored
@ -3,7 +3,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 3135-logic
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
user:
|
user:
|
||||||
@ -50,6 +49,10 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
working-directory: ${{ env.WORKING_DIR }}
|
working-directory: ${{ env.WORKING_DIR }}
|
||||||
steps:
|
steps:
|
||||||
|
##########################################################################################################################################
|
||||||
|
|
||||||
|
# setup
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Golang with cache
|
- name: Setup Golang with cache
|
||||||
@ -63,6 +66,51 @@ jobs:
|
|||||||
- run: mkdir ${TEST_RESULT}
|
- run: mkdir ${TEST_RESULT}
|
||||||
- run: mkdir ${CORSO_LOG_DIR}
|
- run: mkdir ${CORSO_LOG_DIR}
|
||||||
|
|
||||||
|
##########################################################################################################################################
|
||||||
|
|
||||||
|
# Pre-Run cleanup
|
||||||
|
|
||||||
|
# unlike CI tests, sanity tests are not expected to run concurrently.
|
||||||
|
# however, the sanity yaml concurrency is set to a maximum of 1 run, preferring
|
||||||
|
# the latest release. If we wait to clean up the production til after the tests
|
||||||
|
# It would be possible to complete all the testing but cancel the run before
|
||||||
|
# cleanup occurs. Setting the cleanup before the tests ensures we always begin
|
||||||
|
# with a clean slate, and cannot compound data production.
|
||||||
|
- name: Set purge boundary
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
echo "NOW=$(date +"%Y-%m-%d_%H-%M-%S")" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Purge CI-Produced Folders for Users
|
||||||
|
uses: ./.github/actions/purge-m365-data
|
||||||
|
with:
|
||||||
|
user: ${TEST_USER}
|
||||||
|
folder-prefix: ${RESTORE_DEST_PFX}
|
||||||
|
older-than: ${{ env.NOW }}
|
||||||
|
azure-client-id: ${AZURE_CLIENT_ID}
|
||||||
|
azure-client-secret: ${AZURE_CLIENT_SECRET}
|
||||||
|
azure-tenant-id: ${AZURE_TENANT_ID}
|
||||||
|
m365-admin-user: ${{ secrets.M365_TENANT_ADMIN_USER }}
|
||||||
|
m365-admin-password: ${{ secrets.M365_TENANT_ADMIN_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Purge CI-Produced Folders for Sites
|
||||||
|
if: always()
|
||||||
|
uses: ./.github/actions/purge-m365-data
|
||||||
|
with:
|
||||||
|
site: ${TEST_SITE}
|
||||||
|
folder-prefix: ${RESTORE_DEST_PFX}
|
||||||
|
libraries: ${{ vars.CORSO_M365_TEST_SITE_LIBRARIES }}
|
||||||
|
older-than: ${{ env.NOW }}
|
||||||
|
azure-client-id: ${AZURE_CLIENT_ID}
|
||||||
|
azure-client-secret: ${AZURE_CLIENT_SECRET}
|
||||||
|
azure-tenant-id: ${AZURE_TENANT_ID}
|
||||||
|
m365-admin-user: ${{ secrets.M365_TENANT_ADMIN_USER }}
|
||||||
|
m365-admin-password: ${{ secrets.M365_TENANT_ADMIN_PASSWORD }}
|
||||||
|
|
||||||
|
##########################################################################################################################################
|
||||||
|
|
||||||
|
# Repository commands
|
||||||
|
|
||||||
- name: Version Test
|
- name: Version Test
|
||||||
run: |
|
run: |
|
||||||
./corso --version | grep -c 'Corso version:'
|
./corso --version | grep -c 'Corso version:'
|
||||||
@ -266,7 +314,7 @@ jobs:
|
|||||||
|
|
||||||
##########################################################################################################################################
|
##########################################################################################################################################
|
||||||
|
|
||||||
# Logging & Notify
|
# Logging & Notifications
|
||||||
|
|
||||||
# Upload the original go test output as an artifact for later review.
|
# Upload the original go test output as an artifact for later review.
|
||||||
- name: Upload test log
|
- name: Upload test log
|
||||||
@ -307,4 +355,4 @@ jobs:
|
|||||||
}
|
}
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
|
||||||
Loading…
x
Reference in New Issue
Block a user