re-enable stderr logs in tests (#2215)

## Does this PR need a docs update or release note?

- [x]  No 

## Type of change

- [x] 🐛 Bugfix
- [x] 🤖 Test
- [x] 💻 CI/Deployment

## Test Plan

- [x] 💪 Manual
This commit is contained in:
Keepers 2023-01-23 12:52:26 -07:00 committed by GitHub
parent b6a7095c7f
commit e43455cc49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -208,6 +208,7 @@ jobs:
CORSO_M365_TEST_USER_ID: ${{ secrets.CORSO_M365_TEST_USER_ID }} CORSO_M365_TEST_USER_ID: ${{ secrets.CORSO_M365_TEST_USER_ID }}
CORSO_SECONDARY_M365_TEST_USER_ID: ${{ secrets.CORSO_SECONDARY_M365_TEST_USER_ID }} CORSO_SECONDARY_M365_TEST_USER_ID: ${{ secrets.CORSO_SECONDARY_M365_TEST_USER_ID }}
CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }} CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }}
CORSO_LOG_FILE: stderr
LOG_GRAPH_REQUESTS: true LOG_GRAPH_REQUESTS: true
run: | run: |
set -euo pipefail set -euo pipefail
@ -219,7 +220,7 @@ jobs:
-p 1 \ -p 1 \
./... 2>&1 | tee ./testlog/gotest.log | gotestfmt -hide successful-tests ./... 2>&1 | tee ./testlog/gotest.log | gotestfmt -hide successful-tests
# Upload the original go test log 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() if: failure()
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

View File

@ -53,6 +53,7 @@ jobs:
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
CORSO_LOAD_TESTS: true CORSO_LOAD_TESTS: true
CORSO_LOG_FILE: stderr
CORSO_M365_LOAD_TEST_USER_ID: ${{ secrets.CORSO_M365_LOAD_TEST_USER_ID }} CORSO_M365_LOAD_TEST_USER_ID: ${{ secrets.CORSO_M365_LOAD_TEST_USER_ID }}
CORSO_M365_LOAD_TEST_ORG_USERS: ${{ secrets.CORSO_M365_LOAD_TEST_ORG_USERS }} CORSO_M365_LOAD_TEST_ORG_USERS: ${{ secrets.CORSO_M365_LOAD_TEST_ORG_USERS }}
CORSO_PASSPHRASE: ${{ secrets.CORSO_PASSPHRASE }} CORSO_PASSPHRASE: ${{ secrets.CORSO_PASSPHRASE }}

View File

@ -106,6 +106,11 @@ func PreloadLoggingFlags() (string, string) {
return "info", dlf return "info", dlf
} }
// if not specified, attempt to fall back to env declaration.
if len(logfile) == 0 {
logfile = os.Getenv("CORSO_LOG_FILE")
}
if logfile == "-" { if logfile == "-" {
logfile = "stdout" logfile = "stdout"
} }