Skip to content

Comments

Add tagging support to Android and Swift examples#35

Open
pda wants to merge 5 commits intomainfrom
android-and-swift-tagging
Open

Add tagging support to Android and Swift examples#35
pda wants to merge 5 commits intomainfrom
android-and-swift-tagging

Conversation

@pda
Copy link
Member

@pda pda commented Feb 16, 2026

Demonstrate upload-level and execution-level tagging in the Android and Swift examples.

Changes

  • Android: Add upload-level tags via Gradle DSL (buildkiteTestAnalytics { tags[…] }) for test.framework.name, language.name, and custom.tag.from
  • Swift: Add upload-level tags via BUILDKITE_ANALYTICS_TAGS env var in pipeline, and execution-level tagging via self.tagExecution() XCTestCase extension on testAdd

Temporary: branch-pinned collector dependencies

These are now released.

Both collector dependencies currently point at unreleased tagging branches rather than published versions. This will be reverted before merge, once the following PRs are merged and released:

Android additionally clones and publishes the collector to Maven Local at build time (android/bin/test).

pda and others added 4 commits February 16, 2026 16:36
Switch both collector dependencies to their respective pda/add-tagging-support
branches so we can test unreleased tagging support:

- Android: clone test-collector-android PR branch and publishToMavenLocal,
  use 0.3.0-SNAPSHOT with mavenLocal() repositories
- Swift: use branch dependency instead of version-pinned dependency,
  remove Package.resolved to allow fresh resolution

This commit can be reverted independently once the collector PRs are merged
and new versions are released.

Refs:
- buildkite/test-collector-android#28
- buildkite/test-collector-swift#69

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c5691-d421-721c-adb4-df2a4b312a32
Android (unit tests):
- Upload-level tags via Gradle DSL: buildkiteTestAnalytics { tags[...] }
  Sets test.framework.name=junit and custom.tag.from=upload

Swift (XCTest):
- Upload-level tags via BUILDKITE_ANALYTICS_TAGS env var in pipeline
  Sets test.framework.name=xctest and custom.tag.from=upload
- Execution-level tag via self.tagExecution() XCTestCase extension
  Sets custom.tag.from=execution on testAdd

Follows the same tagging patterns used by the ruby, python, and JS examples.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019c5691-d421-721c-adb4-df2a4b312a32
Demonstrate execution-level tagging via self.tagExecution() on testAdd.
Requires import Core since the XCTestCase tagging extension lives in the
Core module of test-collector-swift (not re-exported by BuildkiteTestCollector).

Android unit tests don't support execution-level tagging yet — the
UnitTestListener doesn't bind the observer to BuildkiteExecutionTags,
and BuildkiteExecutionTags is in the instrumented-test-collector module
which is separate from the unit-test-collector.
@pda pda changed the title Add Android and Swift examples with tagging support Add tagging support to Android and Swift examples Feb 16, 2026
Revert the temporary PR branch workarounds from 9a277fe and use the
newly released versions:

- Android collector: 0.4.0 (was 0.4.0-SNAPSHOT from PR branch)
- Swift collector: 0.6.0 (was branch: pda/add-tagging-support)

Removes mavenLocal() repositories and the clone/publishToMavenLocal
hack from android/bin/test. Restores swift-xctest/Package.resolved.

Amp-Thread-ID: https://ampcode.com/threads/T-019c6a0e-4ece-76dc-83b6-550b7cca126b
Co-authored-by: Amp <amp@ampcode.com>
@pda
Copy link
Member Author

pda commented Feb 18, 2026

This is working for Swift:
image

And Android:
image

(but we can't currently do per-execution tagging in Android unit tests, only instrumented tests in emulators etc)

@pda pda marked this pull request as ready for review February 18, 2026 01:51
@pda pda requested a review from a team February 18, 2026 04:15
@pda
Copy link
Member Author

pda commented Feb 20, 2026

@codex review please

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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