Compare commits

...

152 Commits

Author SHA1 Message Date
HiteshRepo
053323719e select creds 2024-02-05 20:50:35 +05:30
HiteshRepo
79a0248049 re trigger CI 2024-02-05 20:46:00 +05:30
HiteshRepo
d0b4b2745d get concated M365 creds 2024-02-05 20:39:56 +05:30
HiteshRepo
8286bb1ffe pass all m365 acc for trusted tests 2024-02-04 12:59:30 +05:30
HiteshRepo
81ce531472 change slot 2024-02-02 21:12:21 +05:30
HiteshRepo
73dd557a91 run another test 2024-02-02 21:06:45 +05:30
HiteshRepo
e4026a7756 re run 2024-02-02 21:03:20 +05:30
HiteshRepo
81276b9ac1 change slot 2024-02-02 21:00:46 +05:30
HiteshRepo
2b68c8157e re run 2024-02-02 20:47:26 +05:30
HiteshRepo
f6b2958cc9 do not read aws creds 2024-02-02 20:44:49 +05:30
HiteshRepo
61d6a59ef1 re run 2024-02-02 20:40:32 +05:30
HiteshRepo
a4fe50c4d8 comment almost whole test 2024-02-02 20:38:17 +05:30
HiteshRepo
b37715a445 re run 2024-02-02 20:33:36 +05:30
HiteshRepo
1592070a14 comment some more 2024-02-02 20:30:30 +05:30
HiteshRepo
a14dab97ab re run 2024-02-02 20:26:26 +05:30
HiteshRepo
e421676b44 comment some code 2024-02-02 20:24:58 +05:30
HiteshRepo
a791587361 log env var that were read 2024-02-02 20:06:51 +05:30
HiteshRepo
dd48678bc4 re run 2024-02-02 19:46:28 +05:30
HiteshRepo
9de1a1802e run diff test 2024-02-02 19:44:15 +05:30
HiteshRepo
ec31a68371 re run 2024-02-02 19:19:44 +05:30
HiteshRepo
65b169a134 slot constant-ed 2024-02-02 19:16:59 +05:30
HiteshRepo
bc0990ad4c use accSelector.yaml@ci-cache-enable 2024-02-02 19:12:07 +05:30
HiteshRepo
08a3a1da4e fix slot 2024-02-02 19:04:44 +05:30
HiteshRepo
6d20069928 make azure creds constant - 2 2024-02-02 18:55:59 +05:30
HiteshRepo
39c70bcafc make azure creds constant 2024-02-02 18:53:23 +05:30
HiteshRepo
d028764fe7 re run 2024-01-31 16:14:32 +05:30
HiteshRepo
9a6edab353 check if w/o file creation test gets cached 2024-01-31 15:56:44 +05:30
HiteshRepo
0144eebb55 re run 2024-01-30 17:54:04 +05:30
HiteshRepo
a296b64f16 use temp dir 2024-01-30 17:51:08 +05:30
HiteshRepo
7636882a53 run one more time 2024-01-30 17:46:07 +05:30
HiteshRepo
ae5678389d re run 2024-01-30 17:33:04 +05:30
HiteshRepo
cb3c7da53b returns constant repo hash name for test 2024-01-30 17:30:10 +05:30
HiteshRepo
1a584fb95a re run 2024-01-30 17:12:50 +05:30
HiteshRepo
38f9ad03b4 peek 2024-01-30 17:09:04 +05:30
HiteshRepo
dbc1da92dc removes v flag 2024-01-30 17:06:36 +05:30
HiteshRepo
c18c2eb6d6 re run 2024-01-30 17:03:13 +05:30
HiteshRepo
1a1c888fb4 pass test dir 2024-01-30 16:59:48 +05:30
HiteshRepo
464dc95627 uploading whole test log 2024-01-30 16:26:55 +05:30
HiteshRepo
ee21611018 fix 2024-01-30 16:19:46 +05:30
HiteshRepo
e13eb26905 adds verbose flag 2024-01-30 16:13:36 +05:30
HiteshRepo
9c44541787 log kopia config dir 2024-01-30 16:09:02 +05:30
HiteshRepo
7a9678b4a2 re run 2024-01-30 15:52:41 +05:30
HiteshRepo
e509bf1015 runs only TestBackup_Run_exchange 2024-01-30 15:49:26 +05:30
HiteshRepo
0f83579a78 run all unit and retention tests 2024-01-30 15:45:59 +05:30
HiteshRepo
089020836d re run 2024-01-29 20:06:31 +05:30
HiteshRepo
f6fbec30dc skip 2 retention tests 2024-01-29 19:40:12 +05:30
HiteshRepo
ac5244f9bc re run 2024-01-29 19:35:47 +05:30
HiteshRepo
f7ce1208f8 tests TestRetentionIntegrationSuite 2024-01-29 19:33:23 +05:30
HiteshRepo
f440698c2d re run 2024-01-29 19:29:35 +05:30
HiteshRepo
4f0653c6c3 run only one suite kopia pk 2024-01-29 19:25:31 +05:30
HiteshRepo
c5ee023e7d peek 2 2024-01-29 18:42:46 +05:30
HiteshRepo
cc53e77c77 peek src 2024-01-29 18:39:08 +05:30
HiteshRepo
9da2e6536d re run 2024-01-29 18:27:33 +05:30
HiteshRepo
8595ff1088 comments some more 2024-01-29 18:26:45 +05:30
HiteshRepo
3305f1ffd4 re run 2024-01-29 18:23:20 +05:30
HiteshRepo
4505933aaa comment some more 2024-01-29 18:21:50 +05:30
HiteshRepo
619d13483b re run 2024-01-29 18:13:19 +05:30
HiteshRepo
bdaeaec3cd comment some test code 2024-01-29 18:12:25 +05:30
HiteshRepo
18098c9825 re run 2024-01-29 18:10:50 +05:30
HiteshRepo
5cb141b6cd test logger pkg 2024-01-29 18:07:37 +05:30
HiteshRepo
196f4013c3 re run 2024-01-29 18:01:48 +05:30
HiteshRepo
4d865e793a uncomment 2024-01-29 17:59:21 +05:30
HiteshRepo
7354262804 re run 2024-01-29 17:57:02 +05:30
HiteshRepo
1438f2f408 comment some more tests 2024-01-29 17:54:42 +05:30
HiteshRepo
0094c7a2fe comment test involving file write in pkg int test 2024-01-29 17:49:11 +05:30
HiteshRepo
76ba41313e re run 2024-01-29 17:38:53 +05:30
HiteshRepo
dab3dd4d66 check input IDs 2024-01-29 17:30:04 +05:30
HiteshRepo
d91116b122 re run 2024-01-29 17:24:03 +05:30
HiteshRepo
27f828759a correct the package run 2024-01-29 17:21:23 +05:30
HiteshRepo
46770fb12b run test for only config pkg 2024-01-29 17:18:43 +05:30
HiteshRepo
8956d2642c revert 2024-01-29 17:09:23 +05:30
HiteshRepo
722b0c7157 comment few tests 2024-01-29 17:04:59 +05:30
HiteshRepo
a2f9d70035 run 3 2024-01-29 16:45:06 +05:30
HiteshRepo
7c49832b54 re re run 2024-01-29 16:36:09 +05:30
HiteshRepo
ecc6e5eb8b re run 2024-01-29 16:29:40 +05:30
HiteshRepo
7f3549f2af run only one suite for trusted 2024-01-29 16:24:14 +05:30
HiteshRepo
6c7c57e92a run only one test for trusted tests 2024-01-29 15:18:21 +05:30
HiteshRepo
ffcd42badc re run 2024-01-29 13:27:39 +05:30
HiteshRepo
e1e6055351 same changes for trusted tests 2024-01-29 13:17:59 +05:30
HiteshRepo
f0f2639a40 re run 2024-01-29 13:04:12 +05:30
HiteshRepo
9bd4184097 update dir for retention test log 2024-01-29 13:01:10 +05:30
HiteshRepo
9d7e13812d re run again 2024-01-29 12:57:09 +05:30
HiteshRepo
ff70aae98b re run 2024-01-29 11:23:30 +05:30
HiteshRepo
1083ef096d remove json and v flags temporarily 2024-01-29 11:17:43 +05:30
HiteshRepo
46c75e1b4f re run 2024-01-29 11:12:57 +05:30
HiteshRepo
fb2977a335 update cache key for retention 2024-01-29 11:02:07 +05:30
HiteshRepo
9c0d8fc46c make same changes to retention tests 2024-01-29 10:34:46 +05:30
HiteshRepo
df2753428b peek some data 2024-01-29 10:26:12 +05:30
HiteshRepo
19ff21cb02 re-run 2024-01-29 10:17:36 +05:30
HiteshRepo
68eb8e77d1 remove cache debug 2024-01-29 10:13:25 +05:30
HiteshRepo
97871c6071 re run 2024-01-28 21:39:50 +05:30
HiteshRepo
de25ca69cb all tests 2024-01-28 21:33:06 +05:30
HiteshRepo
9939182054 run again 2024-01-28 21:29:14 +05:30
HiteshRepo
a2c6cf1085 fix test log dir 2024-01-28 21:25:59 +05:30
HiteshRepo
b04cd5aa4d some changes 2024-01-28 21:23:08 +05:30
HiteshRepo
7441d957e1 re-test those packages 2024-01-28 20:54:42 +05:30
HiteshRepo
3b377e12f5 run each test in the suites 2024-01-28 20:51:11 +05:30
HiteshRepo
87b6d79217 runs only 2 suites of site coll package - 2nd 2024-01-28 20:45:32 +05:30
HiteshRepo
2b5a14e6ae runs only 2 suites of site coll package 2024-01-28 20:42:15 +05:30
HiteshRepo
ce42add8ce re-check cache for site collection pkg 2024-01-28 20:37:46 +05:30
HiteshRepo
cb547c7b06 re-adds test to trigger ci 2024-01-28 20:33:54 +05:30
HiteshRepo
16978c3a43 test all suites individually 2024-01-28 20:31:05 +05:30
HiteshRepo
f1c4a1fce3 removes test 2024-01-28 20:26:18 +05:30
HiteshRepo
7f458b047e run all tests in the package site 2024-01-28 20:23:13 +05:30
HiteshRepo
fbb8bc7fe7 removes test 2024-01-28 20:18:17 +05:30
HiteshRepo
2623698f9f run all tests in suite TestSharePointSuite 2024-01-28 20:16:09 +05:30
HiteshRepo
0bc29426dd removes unwanted test 2024-01-28 18:24:28 +05:30
HiteshRepo
97860ba336 tests only TestSharePointSuite/TestCollectLists 2024-01-28 18:21:55 +05:30
HiteshRepo
b098f977e2 remove additional test 2024-01-28 17:55:46 +05:30
HiteshRepo
49666b8a6d all tests - 2nd run 2024-01-28 14:52:17 +05:30
HiteshRepo
b9d12bfd7d run all tests 2024-01-28 14:46:27 +05:30
HiteshRepo
0e07dacdee run one test 2024-01-28 14:42:27 +05:30
HiteshRepo
4a352ae097 check effect of timeout flag - 2nd run 2024-01-28 14:38:26 +05:30
HiteshRepo
d9568f8d12 check effect of timeout flag 2024-01-28 14:35:55 +05:30
HiteshRepo
aaea75590c check effect of parallel flag 2024-01-28 14:33:16 +05:30
HiteshRepo
9665a2401c check effect of failfast flag - 2nd run 2024-01-28 14:29:51 +05:30
HiteshRepo
e0711aa1b8 check effect of failfast flag 2024-01-28 14:27:13 +05:30
HiteshRepo
fcf327c5e4 check effect of verbosity flag 2024-01-28 14:24:25 +05:30
HiteshRepo
5f7468aa02 checks effect of tags - 2nd run 2024-01-28 14:21:41 +05:30
HiteshRepo
1c780744d2 checks effect of tags 2024-01-28 14:18:46 +05:30
HiteshRepo
f4b8fa190f checks effect of env var 2024-01-28 14:15:09 +05:30
HiteshRepo
94b1eaceee run both test in 1 2024-01-28 14:12:38 +05:30
HiteshRepo
a5e2617853 change to trigger ci 2024-01-28 14:07:48 +05:30
HiteshRepo
4881345415 some file for both tests 2024-01-28 14:05:16 +05:30
HiteshRepo
9f7aba555d some change 2024-01-28 14:02:54 +05:30
HiteshRepo
649138c9c0 more test to trigger ci 2024-01-28 13:59:34 +05:30
HiteshRepo
d90238e828 adds one more test in ci 2024-01-28 13:56:32 +05:30
HiteshRepo
9909335b76 triggers ci 2024-01-28 13:51:34 +05:30
HiteshRepo
b872d57f0c renames test 2024-01-28 13:39:44 +05:30
HiteshRepo
10aa0a93e5 adds new test 2024-01-28 13:03:49 +05:30
HiteshRepo
c5e4d99d70 revert to single test 2024-01-28 13:01:39 +05:30
HiteshRepo
fe95d210dc removes test case 2024-01-28 12:55:28 +05:30
HiteshRepo
b93608e53d removes json flag for tests 2024-01-28 12:49:48 +05:30
HiteshRepo
0739b3525b removes test 2024-01-28 12:44:26 +05:30
HiteshRepo
8fd8ae9094 removes filter 2024-01-28 12:28:00 +05:30
HiteshRepo
9924c742e8 modify the grep command 2024-01-28 12:19:12 +05:30
HiteshRepo
b776a3b209 run all unit tests 2024-01-28 12:13:47 +05:30
HiteshRepo
274e32d331 adds grep filter 2024-01-28 12:04:42 +05:30
HiteshRepo
b187990a06 removes losg filter 2024-01-28 11:56:27 +05:30
HiteshRepo
ac1bb9a866 reduces logs clutter 2024-01-28 11:52:33 +05:30
HiteshRepo
bf60df48e5 push test logs to file 2024-01-28 11:44:42 +05:30
HiteshRepo
5c0ceaf781 upload always 2024-01-28 11:41:17 +05:30
HiteshRepo
a337785542 adds new test to trigger 2024-01-28 11:38:43 +05:30
HiteshRepo
4de11255c8 runs only on test for convinience 2024-01-28 11:34:26 +05:30
HiteshRepo
2ef01e38bd re-adds test case to trigger ci 2024-01-28 11:15:34 +05:30
HiteshRepo
84c4894bf7 change cache key temporarily 2024-01-28 10:56:52 +05:30
HiteshRepo
08ed18b15d removes a test case to trigger a commit 2024-01-28 10:54:27 +05:30
HiteshRepo
35022dc961 removes gotestfmt filter 2024-01-28 10:42:31 +05:30
HiteshRepo
324b23c46b make unit test use cache explicit 2024-01-27 22:51:42 +05:30
HiteshRepo
ede0c6ee83 change dummy test 2024-01-27 22:24:18 +05:30
HiteshRepo
82dafe15c3 unit testing | replace magnetikonline with actions 2024-01-27 22:11:41 +05:30
HiteshRepo
1bae17b48d adds dummy test 2024-01-27 21:36:42 +05:30
9 changed files with 287 additions and 192 deletions

View File

@ -22,7 +22,8 @@ jobs:
- name: Figure out which client id to use
id: roundrobin
run: |
slot=$((GITHUB_RUN_NUMBER % 4))
# slot=$((GITHUB_RUN_NUMBER % 4))
slot=2
echo "CLIENT_APP_SLOT=$slot" >> $GITHUB_OUTPUT
case $slot in

View File

@ -52,7 +52,18 @@ jobs:
# SetM365App will decide which M365 app to use for this CI run
SetM365App:
uses: alcionai/corso/.github/workflows/accSelector.yaml@main
environment: Testing
runs-on: ubuntu-latest
outputs:
client_app_slot: ${{ steps.roundrobin.outputs.CLIENT_APP_SLOT }}
client_id_env: ${{ steps.roundrobin.outputs.CLIENT_ID_ENV }}
client_secret_env: ${{ steps.roundrobin.outputs.CLIENT_SECRET_ENV }}
steps:
- name: sets all client id and secrets
id: roundrobin
run: |
echo "CLIENT_ID_ENV=CLIENT_ID,CLIENT_ID_2,CLIENT_ID_3,CLIENT_ID_4" >> $GITHUB_OUTPUT
echo "CLIENT_SECRET_ENV=CLIENT_SECRET,CLIENT_SECRET_2,CLIENT_SECRET_3,CLIENT_SECRET_4" >> $GITHUB_OUTPUT
SetEnv:
environment: Testing
@ -101,7 +112,6 @@ jobs:
echo "website-cfid=ESFTEIYTIP7Y3" | tee -a $GITHUB_OUTPUT
fi
# ----------------------------------------------------------------------------------------------------
# --- Website Linting -----------------------------------------------------------------------------------
# ----------------------------------------------------------------------------------------------------
@ -136,24 +146,31 @@ jobs:
working-directory: src
env:
# Resolve the name of the secret that contains the Azure client ID/secret
AZURE_CLIENT_ID_NAME: ${{ needs.SetM365App.outputs.client_id_env }}
AZURE_CLIENT_SECRET_NAME: ${{ needs.SetM365App.outputs.client_secret_env }}
AZURE_CLIENT_ID_NAME: ${{ secrets[CLIENT_ID] }},${{ secrets[CLIENT_ID_2] }},${{ secrets[CLIENT_ID_3] }},${{ secrets[CLIENT_ID_4] }}
AZURE_CLIENT_SECRET_NAME: ${{ secrets[CLIENT_SECRET] }},${{ secrets[CLIENT_SECRET_2] }},${{ secrets[CLIENT_SECRET_3] }},${{ secrets[CLIENT_SECRET_4] }}
CLIENT_APP_SLOT: ${{ needs.SetM365App.outputs.client_app_slot }}
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-ci.log
CORSO_LOG_FILE: /tmp/corso-trusted-testlog/run-ci.log
LOG_GRAPH_REQUESTS: true
steps:
- uses: actions/checkout@v4
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: src/go.mod
go-version: 1.21
cache: true
- run: mkdir testlog
- name: Setup Golang caches
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-trusted-${{ github.sha }}
restore-keys: |
${{ runner.os }}-golang-trusted-
# Install gotestfmt
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- run: mkdir -p /tmp/corso-trusted-testlog
# AWS creds
- name: Configure AWS credentials from Test account
@ -166,7 +183,7 @@ jobs:
# run the tests
- name: Integration Tests
env:
AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
AZURE_CLIENT_ID: ${{ secrets[CLIENT_ID] }},${{ secrets[CLIENT_ID_2] }},${{ secrets[CLIENT_ID_3] }},${{ secrets[CLIENT_ID_4] }}
AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
CORSO_CI_TESTS: true
@ -178,21 +195,44 @@ jobs:
set -euo pipefail
go test \
-tags testing \
-json \
-v \
-failfast \
-p 1 \
-v \
-timeout 20m \
./... \
2>&1 | tee ./testlog/gotest-ci.log | gotestfmt -hide successful-tests
-run '^TestDataCollectionIntgSuite/TestExchangeDataCollection$' ./internal/m365 \
2>&1 | tee /tmp/corso-trusted-testlog/gotest-ci.log
- name: peek
run: ls /tmp/corso-trusted-testlog
# # run the tests
# - name: Integration Tests
# env:
# AZURE_CLIENT_ID: ${{ secrets[env.AZURE_CLIENT_ID_NAME] }}
# AZURE_CLIENT_SECRET: ${{ secrets[env.AZURE_CLIENT_SECRET_NAME] }}
# AZURE_TENANT_ID: ${{ secrets.TENANT_ID }}
# CORSO_CI_TESTS: true
# CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }}
# CORSO_SECONDARY_M365_TEST_USER_ID: ${{ vars.CORSO_SECONDARY_M365_TEST_USER_ID }}
# CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
# S3_BUCKET: ${{ secrets.CI_TESTS_S3_BUCKET }}
# run: |
# set -euo pipefail
# go test \
# -tags testing \
# -failfast \
# -p 1 \
# -timeout 20m \
# ./... \
# 2>&1 | tee /tmp/corso-trusted-testlog/gotest-ci.log
# Upload the original go test output as an artifact for later review.
- name: Upload test log
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-test-log
path: src/testlog/*
path: /tmp/corso-trusted-testlog/*
if-no-files-found: error
retention-days: 14
@ -210,21 +250,28 @@ jobs:
AZURE_CLIENT_ID_NAME: ${{ needs.SetM365App.outputs.client_id_env }}
AZURE_CLIENT_SECRET_NAME: ${{ needs.SetM365App.outputs.client_secret_env }}
CLIENT_APP_SLOT: ${{ needs.SetM365App.outputs.client_app_slot }}
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-ci-retention.log
CORSO_LOG_FILE: /tmp/corso-retention-testlog/run-ci-retention.log
LOG_GRAPH_REQUESTS: true
steps:
- uses: actions/checkout@v4
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: src/go.mod
go-version: 1.21
cache: true
- run: mkdir testlog
- name: Setup Golang caches
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-retention-${{ github.sha }}
restore-keys: |
${{ runner.os }}-golang-retention-
# Install gotestfmt
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- run: mkdir -p /tmp/corso-retention-testlog
# AWS creds
- name: Configure AWS credentials from Test account
@ -249,24 +296,25 @@ jobs:
set -euo pipefail
go test \
-tags testing \
-json \
-v \
-failfast \
-p 1 \
-timeout 10m \
./... \
2>&1 | tee ./testlog/gotest-ci.log | gotestfmt -hide successful-tests
2>&1 | tee /tmp/corso-retention-testlog/gotest-ci.log
# Upload the original go test output as an artifact for later review.
- name: Upload test log
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: ci-retention-test-log
path: src/testlog/*
path: /tmp/corso-retention-testlog/*
if-no-files-found: error
retention-days: 14
- name: peek
run: ls
Unit-Test-Suite:
needs: [Precheck, Checkout]
environment: Testing
@ -277,48 +325,54 @@ jobs:
run:
working-directory: src
env:
CORSO_LOG_FILE: ${{ github.workspace }}/src/testlog/run-unit.log
CORSO_LOG_FILE: /tmp/corso-testlog/run-unit.log
LOG_GRAPH_REQUESTS: true
steps:
- uses: actions/checkout@v4
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version-file: src/go.mod
go-version: 1.21
cache: true
- run: mkdir testlog
- name: Setup Golang caches
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-golang-unit-${{ github.sha }}
restore-keys: |
${{ runner.os }}-golang-unit-
# Install gotestfmt
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- run: mkdir -p /tmp/corso-testlog
# run the tests
- name: Unit Tests
env:
# Set these to a bad value so we don't accidentally fall back to
# something elsewhere.
CORSO_M365_TEST_USER_ID: 'foo'
CORSO_SECONDARY_M365_TEST_USER_ID: 'foo'
CORSO_M365_TEST_USER_ID: "foo"
CORSO_SECONDARY_M365_TEST_USER_ID: "foo"
run: |
set -euo pipefail
# Run the first test
go test \
-tags testing \
-json \
-v \
-failfast \
-p 1 \
-timeout 20m \
./... \
2>&1 | tee ./testlog/gotest-unit.log | gotestfmt -hide successful-tests
2>&1 | tee -a /tmp/corso-testlog/gotest-unit.log
# Upload the original go test output as an artifact for later review.
- name: Upload test log
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-log
path: src/testlog/*
path: /tmp/corso-testlog/*
if-no-files-found: error
retention-days: 14
@ -723,7 +777,14 @@ jobs:
cfid: ${{ needs.SetEnv.outputs.website-cfid }}
Publish-Website-Prod:
needs: [SetEnv, Validate-Linux-Artifacts, Validate-MacOS-Artifacts, Validate-Docker-Artifacts, Validate-Windows-Artifacts]
needs:
[
SetEnv,
Validate-Linux-Artifacts,
Validate-MacOS-Artifacts,
Validate-Docker-Artifacts,
Validate-Windows-Artifacts,
]
environment: ${{ needs.SetEnv.outputs.environment }}
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

View File

@ -5,5 +5,6 @@ import "github.com/google/uuid"
const hashLength = 7
func NewHashForRepoConfigName() string {
return uuid.NewString()[:hashLength]
_ = uuid.NewString()[:hashLength]
return "constant"
}

View File

@ -715,6 +715,7 @@ func (suite *RetentionIntegrationSuite) TestSetRetentionParameters() {
}
func (suite *RetentionIntegrationSuite) TestSetRetentionParameters_And_Maintenance() {
suite.T().Skip()
t := suite.T()
ctx, flush := tester.NewContext(t)
@ -796,6 +797,8 @@ func (suite *RetentionIntegrationSuite) TestSetRetentionParameters_And_Maintenan
}
func (suite *RetentionIntegrationSuite) TestSetAndUpdateRetentionParameters_RunMaintenance() {
suite.T().Skip()
table := []struct {
name string
reopen bool

View File

@ -79,35 +79,35 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
}{
{
name: "Mail",
selector: func() *selectors.ExchangeBackup {
sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
sel.Include(sel.MailFolders([]string{api.MailInbox}, selectors.PrefixMatch()))
sel.DiscreteOwner = suite.its.User.ID
// selector: func() *selectors.ExchangeBackup {
// sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
// sel.Include(sel.MailFolders([]string{api.MailInbox}, selectors.PrefixMatch()))
// sel.DiscreteOwner = suite.its.User.ID
return sel
},
category: path.EmailCategory,
metadataFiles: MetadataFileNames(path.EmailCategory),
// return sel
// },
// category: path.EmailCategory,
// metadataFiles: MetadataFileNames(path.EmailCategory),
},
{
name: "Contacts",
selector: func() *selectors.ExchangeBackup {
sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
sel.Include(sel.ContactFolders([]string{api.DefaultContacts}, selectors.PrefixMatch()))
return sel
},
category: path.ContactsCategory,
metadataFiles: MetadataFileNames(path.ContactsCategory),
// selector: func() *selectors.ExchangeBackup {
// sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
// sel.Include(sel.ContactFolders([]string{api.DefaultContacts}, selectors.PrefixMatch()))
// return sel
// },
// category: path.ContactsCategory,
// metadataFiles: MetadataFileNames(path.ContactsCategory),
},
{
name: "Calendar Events",
selector: func() *selectors.ExchangeBackup {
sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
sel.Include(sel.EventCalendars([]string{api.DefaultCalendar}, selectors.PrefixMatch()))
return sel
},
category: path.EventsCategory,
metadataFiles: MetadataFileNames(path.EventsCategory),
// selector: func() *selectors.ExchangeBackup {
// sel := selectors.NewExchangeBackup([]string{suite.its.User.ID})
// sel.Include(sel.EventCalendars([]string{api.DefaultCalendar}, selectors.PrefixMatch()))
// return sel
// },
// category: path.EventsCategory,
// metadataFiles: MetadataFileNames(path.EventsCategory),
},
}
for _, test := range tests {
@ -128,108 +128,111 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel, opts, version.Backup, counter)
defer bod.Close(t, ctx)
sel = bod.Sel
assert.NotEmpty(t, bo)
assert.NotEmpty(t, whatSet)
userID := sel.ID()
// sel = bod.Sel
m365, err := bod.Acct.M365Config()
require.NoError(t, err, clues.ToCore(err))
// userID := sel.ID()
// run the tests
RunAndCheckBackup(t, ctx, &bo, mb, false)
CheckBackupIsInManifests(
t,
ctx,
bod.KW,
bod.SW,
&bo,
sel,
userID,
test.category)
CheckMetadataFilesExist(
t,
ctx,
bo.Results.BackupID,
bod.KW,
bod.KMS,
m365.AzureTenantID,
userID,
path.ExchangeService,
map[path.CategoryType][][]string{test.category: test.metadataFiles})
// m365, err := bod.Acct.M365Config()
// require.NoError(t, err, clues.ToCore(err))
_, expectDeets := deeTD.GetDeetsInBackup(
t,
ctx,
bo.Results.BackupID,
bod.Acct.ID(),
userID,
path.ExchangeService,
whatSet,
bod.KMS,
bod.SSS)
deeTD.CheckBackupDetails(
t,
ctx,
bo.Results.BackupID,
whatSet,
bod.KMS,
bod.SSS,
expectDeets,
false)
// // run the tests
// RunAndCheckBackup(t, ctx, &bo, mb, false)
// CheckBackupIsInManifests(
// t,
// ctx,
// bod.KW,
// bod.SW,
// &bo,
// sel,
// userID,
// test.category)
// CheckMetadataFilesExist(
// t,
// ctx,
// bo.Results.BackupID,
// bod.KW,
// bod.KMS,
// m365.AzureTenantID,
// userID,
// path.ExchangeService,
// map[path.CategoryType][][]string{test.category: test.metadataFiles})
// Basic, happy path incremental test. No changes are dictated or expected.
// This only tests that an incremental backup is runnable at all, and that it
// produces fewer results than the last backup.
var (
incMB = evmock.NewBus()
incBO = NewTestBackupOp(
t,
ctx,
bod,
incMB,
opts,
counter)
)
// _, expectDeets := deeTD.GetDeetsInBackup(
// t,
// ctx,
// bo.Results.BackupID,
// bod.Acct.ID(),
// userID,
// path.ExchangeService,
// whatSet,
// bod.KMS,
// bod.SSS)
// deeTD.CheckBackupDetails(
// t,
// ctx,
// bo.Results.BackupID,
// whatSet,
// bod.KMS,
// bod.SSS,
// expectDeets,
// false)
RunAndCheckBackup(t, ctx, &incBO, incMB, true)
CheckBackupIsInManifests(
t,
ctx,
bod.KW,
bod.SW,
&incBO,
sel,
userID,
test.category)
CheckMetadataFilesExist(
t,
ctx,
incBO.Results.BackupID,
bod.KW,
bod.KMS,
m365.AzureTenantID,
userID,
path.ExchangeService,
map[path.CategoryType][][]string{test.category: test.metadataFiles})
deeTD.CheckBackupDetails(
t,
ctx,
incBO.Results.BackupID,
whatSet,
bod.KMS,
bod.SSS,
expectDeets,
false)
// // Basic, happy path incremental test. No changes are dictated or expected.
// // This only tests that an incremental backup is runnable at all, and that it
// // produces fewer results than the last backup.
// var (
// incMB = evmock.NewBus()
// incBO = NewTestBackupOp(
// t,
// ctx,
// bod,
// incMB,
// opts,
// counter)
// )
// do some additional checks to ensure the incremental dealt with fewer items.
assert.Greater(t, bo.Results.ItemsWritten, incBO.Results.ItemsWritten, "incremental items written")
assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read")
assert.Greater(t, bo.Results.BytesRead, incBO.Results.BytesRead, "incremental bytes read")
assert.Greater(t, bo.Results.BytesUploaded, incBO.Results.BytesUploaded, "incremental bytes uploaded")
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error", clues.ToCore(bo.Errors.Failure()))
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
// RunAndCheckBackup(t, ctx, &incBO, incMB, true)
// CheckBackupIsInManifests(
// t,
// ctx,
// bod.KW,
// bod.SW,
// &incBO,
// sel,
// userID,
// test.category)
// CheckMetadataFilesExist(
// t,
// ctx,
// incBO.Results.BackupID,
// bod.KW,
// bod.KMS,
// m365.AzureTenantID,
// userID,
// path.ExchangeService,
// map[path.CategoryType][][]string{test.category: test.metadataFiles})
// deeTD.CheckBackupDetails(
// t,
// ctx,
// incBO.Results.BackupID,
// whatSet,
// bod.KMS,
// bod.SSS,
// expectDeets,
// false)
// // do some additional checks to ensure the incremental dealt with fewer items.
// assert.Greater(t, bo.Results.ItemsWritten, incBO.Results.ItemsWritten, "incremental items written")
// assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read")
// assert.Greater(t, bo.Results.BytesRead, incBO.Results.BytesRead, "incremental bytes read")
// assert.Greater(t, bo.Results.BytesUploaded, incBO.Results.BytesUploaded, "incremental bytes uploaded")
// assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
// assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error", clues.ToCore(bo.Errors.Failure()))
// assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
// assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
})
}
}

View File

@ -390,26 +390,27 @@ func NewIntegrationTesterSetup(t *testing.T) IntgTesterSetup {
a := tconfig.NewM365Account(t)
creds, err := a.M365Config()
require.NoError(t, err, clues.ToCore(err))
assert.NotEmpty(t, creds)
counter := count.New()
// counter := count.New()
its.AC, err = api.NewClient(
creds,
control.DefaultOptions(),
counter)
require.NoError(t, err, clues.ToCore(err))
// its.AC, err = api.NewClient(
// creds,
// control.DefaultOptions(),
// counter)
// require.NoError(t, err, clues.ToCore(err))
its.GockAC, err = GockClient(creds, counter)
require.NoError(t, err, clues.ToCore(err))
// its.GockAC, err = GockClient(creds, counter)
// require.NoError(t, err, clues.ToCore(err))
its.User = userIDs(t, tconfig.M365UserID(t), its.AC)
its.SecondaryUser = userIDs(t, tconfig.SecondaryM365UserID(t), its.AC)
its.Site = siteIDs(t, tconfig.M365SiteID(t), its.AC)
its.SecondarySite = siteIDs(t, tconfig.SecondaryM365SiteID(t), its.AC)
// teamID is used here intentionally. We want the group
// to have access to teams data
its.Group = groupIDs(t, tconfig.M365TeamID(t), its.AC)
its.SecondaryGroup = groupIDs(t, tconfig.SecondaryM365TeamID(t), its.AC)
// its.User = userIDs(t, tconfig.M365UserID(t), its.AC)
// its.SecondaryUser = userIDs(t, tconfig.SecondaryM365UserID(t), its.AC)
// its.Site = siteIDs(t, tconfig.M365SiteID(t), its.AC)
// its.SecondarySite = siteIDs(t, tconfig.SecondaryM365SiteID(t), its.AC)
// // teamID is used here intentionally. We want the group
// // to have access to teams data
// its.Group = groupIDs(t, tconfig.M365TeamID(t), its.AC)
// its.SecondaryGroup = groupIDs(t, tconfig.SecondaryM365TeamID(t), its.AC)
return its
}

View File

@ -1,7 +1,10 @@
package credentials
import (
"fmt"
"math/rand"
"os"
"strings"
"github.com/alcionai/clues"
)
@ -25,6 +28,24 @@ func GetM365() M365 {
AzureClientID := os.Getenv(AzureClientID)
AzureClientSecret := os.Getenv(AzureClientSecret)
fmt.Println("---------------> AZURE_CLIENT_ID", AzureClientID)
fmt.Println("---------------> AZURE_CLIENT_SECRET", AzureClientSecret)
fmt.Println("---------------> check", strings.Contains(AzureClientID, ","))
fmt.Println("---------------> check", strings.Contains(AzureClientSecret, ","))
randomNumber := rand.Intn(4) + 1
fmt.Println("---------> random", randomNumber)
if strings.Contains(AzureClientID, ",") {
AzureClientIDs := strings.Split(AzureClientID, ",")
AzureClientID = AzureClientIDs[randomNumber]
}
if strings.Contains(AzureClientID, ",") {
AzureClientSecrets := strings.Split(AzureClientSecret, ",")
AzureClientSecret = AzureClientSecrets[randomNumber]
}
return M365{
AzureClientID: AzureClientID,
AzureClientSecret: AzureClientSecret,

View File

@ -3,12 +3,12 @@ package logger_test
import (
"testing"
"github.com/alcionai/clues"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/alcionai/clues"
"github.com/alcionai/corso/src/internal/tester"
"github.com/alcionai/corso/src/pkg/logger"
)

View File

@ -721,3 +721,7 @@ func (suite *PathUnitSuite) TestArePathsEquivalent() {
})
}
}
func (suite *PathUnitSuite) SomeTest() {
}