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:
Keepers 2023-05-16 23:55:40 -06:00 committed by GitHub
parent e64f93a7d3
commit ff6334131a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ on:
push:
branches:
- main
- 3135-logic
workflow_dispatch:
inputs:
user:
@ -50,6 +49,10 @@ jobs:
run:
working-directory: ${{ env.WORKING_DIR }}
steps:
##########################################################################################################################################
# setup
- uses: actions/checkout@v3
- name: Setup Golang with cache
@ -63,6 +66,51 @@ jobs:
- run: mkdir ${TEST_RESULT}
- 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
run: |
./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.
- name: Upload test log