diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a344bf59..e9edc7e33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,6 +137,8 @@ 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: ./src/testlog/suite-testlogging.log + LOG_GRAPH_REQUESTS: true steps: - uses: actions/checkout@v3 @@ -169,8 +171,6 @@ jobs: 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 }} - CORSO_LOG_FILE: ./src/testlog/testlogging.log - LOG_GRAPH_REQUESTS: true run: | set -euo pipefail go test \ @@ -180,14 +180,15 @@ jobs: -failfast \ -p 1 \ -timeout 15m \ - ./... 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 output as an artifact for later review. - name: Upload test log if: failure() uses: actions/upload-artifact@v3 with: - name: test-log + name: ci-test-log path: src/testlog/* if-no-files-found: error retention-days: 14 @@ -200,6 +201,9 @@ jobs: defaults: run: working-directory: src + env: + CORSO_LOG_FILE: ./src/testlog/unit-testlogging.log + LOG_GRAPH_REQUESTS: true steps: - uses: actions/checkout@v3 @@ -221,8 +225,6 @@ jobs: # something elsewhere. CORSO_M365_TEST_USER_ID: 'foo' CORSO_SECONDARY_M365_TEST_USER_ID: 'foo' - CORSO_LOG_FILE: ./src/testlog/testlogging.log - LOG_GRAPH_REQUESTS: true run: | set -euo pipefail go test \ @@ -232,7 +234,8 @@ jobs: -failfast \ -p 1 \ -timeout 15m \ - ./... 2>&1 | tee ./testlog/gotest-unit.log | gotestfmt -hide successful-tests + ./... \ + 2>&1 | tee ./testlog/gotest-unit.log | gotestfmt -hide successful-tests # Upload the original go test output as an artifact for later review. - name: Upload test log @@ -252,6 +255,9 @@ jobs: defaults: run: working-directory: src + env: + CORSO_LOG_FILE: ./src/testlog/fork-testlogging.log + LOG_GRAPH_REQUESTS: true steps: - name: Fail check if not repository_dispatch if: github.event_name != 'repository_dispatch' @@ -311,21 +317,21 @@ jobs: CORSO_CI_TESTS: true CORSO_M365_TEST_USER_ID: ${{ vars.CORSO_M365_TEST_USER_ID }} CORSO_PASSPHRASE: ${{ secrets.INTEGRATION_TEST_CORSO_PASSPHRASE }} - CORSO_LOG_FILE: ./src/testlog/testlogging.log run: | set -euo pipefail go test \ -json \ -v \ -timeout 15m \ - ./... 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. - name: Upload test log if: failure() uses: actions/upload-artifact@v3 with: - name: test-log + name: fork-test-log path: src/testlog/* if-no-files-found: error retention-days: 14 @@ -333,7 +339,7 @@ jobs: # Update check run called "Test-Suite-Fork" - uses: actions/github-script@v6 id: update-check-run - if: ${{ always() }} + if: failure() env: number: ${{ github.event.client_payload.pull_request.number }} job: ${{ github.job }} diff --git a/.github/workflows/nightly_test.yml b/.github/workflows/nightly_test.yml index 22eddba52..ea313f571 100644 --- a/.github/workflows/nightly_test.yml +++ b/.github/workflows/nightly_test.yml @@ -140,10 +140,10 @@ jobs: # Upload the original go test output as an artifact for later review. - name: Upload test log - if: failure() + if: always() uses: actions/upload-artifact@v3 with: - name: test-log + name: nightly-test-log path: src/testlog/* if-no-files-found: error retention-days: 14 diff --git a/.github/workflows/sanity-test.yaml b/.github/workflows/sanity-test.yaml index 484df7938..c793986e7 100644 --- a/.github/workflows/sanity-test.yaml +++ b/.github/workflows/sanity-test.yaml @@ -321,7 +321,7 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: "test-logs" + name: sanity-test-log path: ${{ env.WORKING_DIR }}/${{ env.CORSO_LOG_DIR }}/ if-no-files-found: error retention-days: 14