Skip to content

Warn when test results are present but Test Reports API token is missing - #269

Open
lpusok wants to merge 2 commits into
masterfrom
SSW-3084-warn-missing-addon-token
Open

Warn when test results are present but Test Reports API token is missing#269
lpusok wants to merge 2 commits into
masterfrom
SSW-3084-warn-missing-addon-token

Conversation

@lpusok

@lpusok lpusok commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Context

Ref: SSW-3084

A customer's test results weren't showing up in the Tests tab on their merge_request_build workflow. Root cause: the Deploy step only uploads test results when it has a addon_api_token (Test Reports API token, sourced from $ADDON_VDTESTING_API_TOKEN). On pull-request-triggered builds this token is not available by default (Bitrise does not expose app-level secrets to PR builds unless explicitly opted in), so the step silently skipped the upload — the only trace in the log was the routine addon_api_token: unset.

Change

  • deployTestResults now always runs (the if config.AddonAPIToken != "" guard around the call site is removed).
  • When test results are present but the token is empty, the step emits a clear warning explaining why the upload was skipped and how to work around it (trigger the build from a push event), then returns instead of attempting the upload.
  • When there are no test results, behavior is unchanged (stays silent).

The step's step.yml already has run_if: .IsCI, so it only runs in CI — no extra CI check is needed.

Warning shown

Test results were found but they will not be uploaded to the Tests tab: the Test Reports API token (addon_api_token) is not set.
This most commonly happens on builds triggered by a pull request, where this token is not available by default.
To upload test results from such builds, trigger the build from a push event instead.

Tests

Added Test_deployTestResults covering: (a) results present + empty token → warning fires, upload not attempted; (b) no results + empty token → stays silent about the token. go build, go vet, and go test ./ all pass.

🤖 Generated with Claude Code

lpusok and others added 2 commits July 23, 2026 15:32
The Deploy step only uploaded test results to the Tests tab when the
addon_api_token was set, and skipped the upload silently otherwise. On
pull-request-triggered builds the token is not available by default, so
users saw no test results and no explanation.

Always run deployTestResults and, when test results are present but the
token is empty, emit a warning explaining why the upload was skipped and
how to work around it (trigger via push), instead of skipping silently.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant