add sanity test boilerplate for groups (#4099)
#### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🤖 Supportability/Tests #### Issue(s) * #3989 #### Test Plan - [x] 💚 E2E
This commit is contained in:
parent
11c6169056
commit
f0422431bc
16
.github/actions/backup-restore-test/action.yml
vendored
16
.github/actions/backup-restore-test/action.yml
vendored
@ -12,7 +12,7 @@ inputs:
|
||||
required: false
|
||||
default: ""
|
||||
restore-args:
|
||||
description: Arguments to pass for restore
|
||||
description: Arguments to pass for restore; restore is skipped when missing.
|
||||
required: false
|
||||
default: ""
|
||||
test-folder:
|
||||
@ -28,6 +28,10 @@ inputs:
|
||||
description: Value for the --collisions flag
|
||||
requried: false
|
||||
default: "replace"
|
||||
with-export:
|
||||
description: Runs export tests when true
|
||||
required: false
|
||||
default: false
|
||||
|
||||
outputs:
|
||||
backup-id:
|
||||
@ -52,6 +56,7 @@ runs:
|
||||
tee $GITHUB_OUTPUT
|
||||
|
||||
- name: Restore ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: inputs.restore != ""
|
||||
id: restore
|
||||
shell: bash
|
||||
working-directory: src
|
||||
@ -73,6 +78,7 @@ runs:
|
||||
cat /tmp/corsologs
|
||||
|
||||
- name: Check restore ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: ${{ inputs.restore != "" }}
|
||||
shell: bash
|
||||
working-directory: src
|
||||
env:
|
||||
@ -86,10 +92,10 @@ runs:
|
||||
./sanity-test
|
||||
|
||||
- name: Export ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: ${{ inputs.with-export == true }}
|
||||
id: export
|
||||
shell: bash
|
||||
working-directory: src
|
||||
if: ${{ inputs.service == 'onedrive' || inputs.service == 'sharepoint' }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-restore-${{ inputs.service }}-${{inputs.kind }}.log
|
||||
@ -103,9 +109,9 @@ runs:
|
||||
cat /tmp/corsologs
|
||||
|
||||
- name: Check export ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: ${{ inputs.with-export == true }}
|
||||
shell: bash
|
||||
working-directory: src
|
||||
if: ${{ inputs.service == 'onedrive' || inputs.service == 'sharepoint' }}
|
||||
env:
|
||||
SANITY_TEST_KIND: export
|
||||
SANITY_TEST_FOLDER: /tmp/export-${{ inputs.service }}-${{inputs.kind }}
|
||||
@ -117,10 +123,10 @@ runs:
|
||||
./sanity-test
|
||||
|
||||
- name: Export archive ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: ${{ inputs.with-export == true }}
|
||||
id: export-archive
|
||||
shell: bash
|
||||
working-directory: src
|
||||
if: ${{ inputs.service == 'onedrive' }} # Export only available for OneDrive
|
||||
run: |
|
||||
set -euo pipefail
|
||||
CORSO_LOG_FILE=${{ inputs.log-dir }}/gotest-restore-${{ inputs.service }}-${{inputs.kind }}.log
|
||||
@ -137,9 +143,9 @@ runs:
|
||||
cat /tmp/corsologs
|
||||
|
||||
- name: Check archive export ${{ inputs.service }} ${{ inputs.kind }}
|
||||
if: ${{ inputs.with-export == true }}
|
||||
shell: bash
|
||||
working-directory: src
|
||||
if: ${{ inputs.service == 'onedrive' }}
|
||||
env:
|
||||
SANITY_TEST_KIND: export
|
||||
SANITY_TEST_FOLDER: /tmp/export-${{ inputs.service }}-${{inputs.kind }}-unzipped
|
||||
|
||||
50
.github/workflows/sanity-test.yaml
vendored
50
.github/workflows/sanity-test.yaml
vendored
@ -241,6 +241,7 @@ jobs:
|
||||
restore-args: '--folder ${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-onedrive.outputs.result }} --restore-permissions'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-onedrive.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
with-export: true
|
||||
|
||||
# generate some more enteries for incremental check
|
||||
- name: OneDrive - Create new data (for incremental)
|
||||
@ -263,6 +264,7 @@ jobs:
|
||||
restore-args: '--folder ${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-onedrive.outputs.result }} --restore-permissions'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-onedrive.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
with-export: true
|
||||
|
||||
##########################################################################################################################################
|
||||
|
||||
@ -295,6 +297,7 @@ jobs:
|
||||
restore-args: '--folder ${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-sharepoint.outputs.result }} --restore-permissions'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-sharepoint.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
with-export: true
|
||||
|
||||
# generate some more enteries for incremental check
|
||||
- name: SharePoint - Create new data (for incremental)
|
||||
@ -318,6 +321,53 @@ jobs:
|
||||
restore-args: '--folder ${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-sharepoint.outputs.result }} --restore-permissions'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-sharepoint.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
with-export: true
|
||||
|
||||
##########################################################################################################################################
|
||||
|
||||
# Groups and Teams
|
||||
|
||||
# generate new entries for test
|
||||
- name: Groups - Create new data
|
||||
if: false # TODO: enable when ready
|
||||
id: new-data-creation-groups
|
||||
working-directory: ./src/cmd/factory
|
||||
run: |
|
||||
suffix=$(date +"%Y-%m-%d_%H-%M-%S")
|
||||
|
||||
go run . sharepoint files \
|
||||
--site ${{ secrets.CORSO_M365_TEST_GROUPS_SITE_URL }} \
|
||||
--user ${{ env.TEST_USER }} \
|
||||
--secondaryuser ${{ env.CORSO_SECONDARY_M365_TEST_USER_ID }} \
|
||||
--tenant ${{ secrets.TENANT_ID }} \
|
||||
--destination ${{ env.RESTORE_DEST_PFX }}$suffix \
|
||||
--count 4
|
||||
|
||||
echo result="${suffix}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Groups - Backup
|
||||
if: false # TODO: enable when ready
|
||||
id: groups-backup
|
||||
uses: ./.github/actions/backup-restore-test
|
||||
with:
|
||||
service: groups
|
||||
kind: initial
|
||||
backup-args: '--group "${{ secrets.CORSO_M365_TEST_TEAM_ID }}"'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-groups.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
|
||||
- name: Teams - Backup
|
||||
if: false # TODO: enable when ready
|
||||
id: teams-backup
|
||||
uses: ./.github/actions/backup-restore-test
|
||||
with:
|
||||
service: teams
|
||||
kind: initial
|
||||
backup-args: '--group "${{ secrets.CORSO_M365_TEST_TEAM_ID }}"'
|
||||
test-folder: '${{ env.RESTORE_DEST_PFX }}${{ steps.new-data-creation-groups.outputs.result }}'
|
||||
log-dir: ${{ env.CORSO_LOG_DIR }}
|
||||
|
||||
# TODO: incrementals
|
||||
|
||||
##########################################################################################################################################
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user