Fixup archive upload for sanity test (#3251)
* now always upload logs * don't use relative paths for things (archive doesn't like it) * build variables off each other * upload whole log file output directory * fix upload action to use the right directory (it doesn't pay attention to working-directory) --- #### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Supportability/Tests - [x] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Test Plan - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E tested locally with nektos act
This commit is contained in:
parent
f2f547f60a
commit
40d8c45ec7
38
.github/workflows/sanity-test.yaml
vendored
38
.github/workflows/sanity-test.yaml
vendored
@ -29,14 +29,18 @@ jobs:
|
|||||||
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
AZURE_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
|
||||||
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
|
||||||
CORSO_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
|
CORSO_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
|
||||||
CORSO_LOG_FILE: ./src/testlog/testlogging.log
|
CORSO_LOG_DIR: testlog
|
||||||
|
CORSO_LOG_FILE: ${{ env.CORSO_LOG_DIR }}/testlogging.log
|
||||||
CORSO_M365_TEST_USER_ID: ${{ github.event.inputs.user != '' && github.event.inputs.user || vars.CORSO_M365_TEST_USER_ID }}
|
CORSO_M365_TEST_USER_ID: ${{ github.event.inputs.user != '' && github.event.inputs.user || vars.CORSO_M365_TEST_USER_ID }}
|
||||||
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
|
||||||
TEST_RESULT: "test_results"
|
TEST_RESULT: test_results
|
||||||
|
# The default working directory doesn't seem to apply to things without
|
||||||
|
# the 'run' directive. https://stackoverflow.com/a/67845456
|
||||||
|
WORKING_DIR: src
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: src
|
working-directory: ${{ env.WORKING_DIR }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@ -49,9 +53,9 @@ jobs:
|
|||||||
|
|
||||||
- run: go build -o sanityCheck ./cmd/sanity_test
|
- run: go build -o sanityCheck ./cmd/sanity_test
|
||||||
|
|
||||||
- run: mkdir test_results
|
- run: mkdir ${TEST_RESULT}
|
||||||
|
|
||||||
- run: mkdir testlog
|
- run: mkdir ${CORSO_LOG_DIR}
|
||||||
|
|
||||||
# run the tests
|
# run the tests
|
||||||
- name: Version Test
|
- name: Version Test
|
||||||
@ -70,7 +74,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
prefix=`date +"%Y-%m-%d-%T"`
|
prefix=`date +"%Y-%m-%d-%T"`
|
||||||
|
echo "Repo init test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso repo init s3 \
|
./corso repo init s3 \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -89,6 +93,7 @@ jobs:
|
|||||||
- name: Repo connect test
|
- name: Repo connect test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nRepo connect test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso repo connect s3 \
|
./corso repo connect s3 \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -120,6 +125,7 @@ jobs:
|
|||||||
- name: Backup exchange test
|
- name: Backup exchange test
|
||||||
id: exchange-test
|
id: exchange-test
|
||||||
run: |
|
run: |
|
||||||
|
echo "\nBackup Exchange test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup create exchange \
|
./corso backup create exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--mailbox "${CORSO_M365_TEST_USER_ID}" \
|
--mailbox "${CORSO_M365_TEST_USER_ID}" \
|
||||||
@ -142,6 +148,7 @@ jobs:
|
|||||||
- name: Backup exchange list test
|
- name: Backup exchange list test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup Exchange list test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup list exchange \
|
./corso backup list exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -157,6 +164,7 @@ jobs:
|
|||||||
- name: Backup exchange list single backup test
|
- name: Backup exchange list single backup test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup Exchange list single backup test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup list exchange \
|
./corso backup list exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -174,6 +182,7 @@ jobs:
|
|||||||
id: exchange-restore-test
|
id: exchange-restore-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup Exchange restore test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso restore exchange \
|
./corso restore exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--email-folder Corso_Restore_st_${{ steps.repo-init.outputs.result }} \
|
--email-folder Corso_Restore_st_${{ steps.repo-init.outputs.result }} \
|
||||||
@ -196,6 +205,7 @@ jobs:
|
|||||||
id: exchange-incremental-test
|
id: exchange-incremental-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup Exchange incremental test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup create exchange \
|
./corso backup create exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -217,6 +227,7 @@ jobs:
|
|||||||
id: exchange-incremantal-restore-test
|
id: exchange-incremantal-restore-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup Exchange incremental restore test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso restore exchange \
|
./corso restore exchange \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -242,6 +253,7 @@ jobs:
|
|||||||
id: onedrive-test
|
id: onedrive-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup create onedrive \
|
./corso backup create onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -263,6 +275,7 @@ jobs:
|
|||||||
- name: Backup onedrive list test
|
- name: Backup onedrive list test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive list test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup list onedrive \
|
./corso backup list onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -275,9 +288,10 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# list the previous onedrive backup
|
# list the previous onedrive backup
|
||||||
- name: Backup onedrive list test
|
- name: Backup onedrive list one backup test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive list one backup test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup list onedrive \
|
./corso backup list onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -295,6 +309,7 @@ jobs:
|
|||||||
id: onedrive-restore-test
|
id: onedrive-restore-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive restore test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso restore onedrive \
|
./corso restore onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--restore-permissions \
|
--restore-permissions \
|
||||||
@ -317,6 +332,7 @@ jobs:
|
|||||||
id: onedrive-incremental-test
|
id: onedrive-incremental-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive incremental test\n" >> ${CORSO_LOG_FILE}
|
||||||
./corso backup create onedrive \
|
./corso backup create onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--hide-progress \
|
--hide-progress \
|
||||||
@ -339,6 +355,7 @@ jobs:
|
|||||||
id: onedrive-incremental-restore-test
|
id: onedrive-incremental-restore-test
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
echo "\nBackup OneDrive incremental restore test\n" >> $CORSO_LOG_FILE
|
||||||
./corso restore onedrive \
|
./corso restore onedrive \
|
||||||
--no-stats \
|
--no-stats \
|
||||||
--restore-permissions \
|
--restore-permissions \
|
||||||
@ -358,11 +375,10 @@ jobs:
|
|||||||
|
|
||||||
# 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
|
||||||
if: failure()
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-log
|
name: test-logs
|
||||||
path: src/testlog/*
|
path: ${{ env.WORKING_DIR }}/${{ env.CORSO_LOG_DIR }}/
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|
||||||
@ -407,4 +423,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