Skip to content

Add tagging support to Android and Swift examples#35

Draft
pda wants to merge 4 commits intomainfrom
android-and-swift-tagging
Draft

Add tagging support to Android and Swift examples#35
pda wants to merge 4 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

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
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