This commit is contained in:
Abin Simon 2024-01-22 17:27:53 +05:30
parent 765ba32b23
commit ebe21472dc

View File

@ -286,7 +286,7 @@ jobs:
uses: magnetikonline/action-golang-cache@v4 uses: magnetikonline/action-golang-cache@v4
with: with:
go-version-file: src/go.mod go-version-file: src/go.mod
cache-key-suffix: -unit-test cache-key-suffix: unit-test
- run: mkdir testlog - run: mkdir testlog
@ -296,55 +296,45 @@ jobs:
- name: one test - name: one test
run: GODEBUG=gocachetest=1 go test -v -run '^TestExportUnitSuite/TestGetItems$' ./internal/m365/service/onedrive run: GODEBUG=gocachetest=1 go test -v -run '^TestExportUnitSuite/TestGetItems$' ./internal/m365/service/onedrive
# Upload the original go test output as an artifact for later review. # - name: fail
- name: Upload test log # run: exit 1
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-log
path: src/testlog/*
if-no-files-found: error
retention-days: 14
- name: fail # # Install gotestfmt
run: exit 1 # - name: Set up gotestfmt
# run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
# Install gotestfmt # # run the tests
- name: Set up gotestfmt # - name: Unit Tests
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest # 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'
# run: |
# set -euo pipefail
# export GODEBUG=gocachehash=1
# go test \
# -tags testing \
# -json \
# -v \
# -failfast \
# -p 1 \
# -timeout 20m \
# ./... \
# 2>./testlog/testcache-hash.log | tee ./testlog/gotest-unit.log
# run the tests # # Upload the original go test output as an artifact for later review.
- name: Unit Tests # - name: Upload test log
env: # if: always()
# Set these to a bad value so we don't accidentally fall back to # uses: actions/upload-artifact@v4
# something elsewhere. # with:
CORSO_M365_TEST_USER_ID: 'foo' # name: unit-test-log
CORSO_SECONDARY_M365_TEST_USER_ID: 'foo' # path: src/testlog/*
run: | # if-no-files-found: error
set -euo pipefail # retention-days: 14
export GODEBUG=gocachehash=1
go test \
-tags testing \
-json \
-v \
-failfast \
-p 1 \
-timeout 20m \
./... \
2>./testlog/testcache-hash.log | tee ./testlog/gotest-unit.log
# Upload the original go test output as an artifact for later review. # - name: fail
- name: Upload test log # run: exit 1
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-log
path: src/testlog/*
if-no-files-found: error
retention-days: 14
- name: fail
run: exit 1
Test-Suite-Fork: Test-Suite-Fork:
needs: [Precheck] needs: [Precheck]