> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trunk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flaky Tests: Upload swift test results with file attribution

> Trunk Analytics CLI 0.15.5 uploads the XML written by swift test and attributes each Swift test to the file it is declared in.

**Swift packages tested with `swift test` now get first-class uploads, with each test linked to its source file.**

### New features

* **Upload `swift test` XML.** Pass `--swift-test-xunit-paths` to upload the reports written by `swift test --xunit-output`. One glob covers both the Swift Testing and XCTest files a run writes. See [Swift Testing](https://docs.trunk.io/flaky-tests/get-started/frameworks/swift-testing.md#test-upload).
* **Tests attributed to their declaring file.** These reports carry no file paths, so Trunk resolves each test to the file it is declared in. CODEOWNERS attribution and file links now work for your Swift tests.
* **GitHub Actions support.** Use the new `swift-test-xunit-paths` input on `trunk-io/analytics-uploader`. See the [GitHub Actions guide](https://docs.trunk.io/flaky-tests/get-started/ci-providers/github-actions.md).
* **Declared-file locations for `.xcresult` (beta).** Add `--use-experimental-xcresult-test-locations` to attribute each test in an `.xcresult` bundle to where it is declared. Passing tests get a file too, and large bundles parse faster. macOS only. See [XCTest](https://docs.trunk.io/flaky-tests/get-started/frameworks/xctest.md#attributing-tests-to-their-declaring-file).

A few things to know:

* **History resets once.** Switching from `--junit-paths` to `--swift-test-xunit-paths` changes test IDs, so affected tests start a fresh history.
* **Pick one format per repository.** The same test uploaded from `.xcresult` and from `swift test` XML counts as two distinct tests.

See the [CLI reference](https://docs.trunk.io/flaky-tests/reference/cli-reference.md) for all upload options.
