From bf57401e51edd7275c40236ee623d6e387de9446 Mon Sep 17 00:00:00 2001 From: AndrasEszes Date: Mon, 5 Oct 2026 18:09:43 +0200 Subject: [PATCH 1/6] Document linking test attachments by file name The page now covers the file name convention that the Deploy to Bitrise.io (2.26.0) and Export test results to Test Reports (1.3.0) Steps use to link attachments to test cases. The manual attachment_* properties stay documented as the alternative. Every example is a one-time setup (a listener, a Gradle task, a path builder, a reporter), so readers don't have to touch their tests. Each was run against the Export Step's matcher. Tools that could only be covered per test class or through deprecated or private APIs (Paparazzi, Shot, Flutter) are left out. The search_pattern examples name a single class XML on purpose: the Export Step exports only its first match, and Gradle writes one XML per test class. CLAUDE.md listed only the languages added in docusaurus.config.ts, which read as if JavaScript, TypeScript and XML blocks were not highlighted. They come bundled with prism-react-renderer. --- CLAUDE.md | 2 +- .../deploying-and-viewing-test-results.mdx | 271 +++++++++++++++++- 2 files changed, 269 insertions(+), 4 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 0bffbc6a..5602918f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -215,7 +215,7 @@ the same `slug:`). ### Code - Inline: backticks for filenames, command names, env var names. ``Open `bitrise.yml`.`` -- Blocks: triple backticks with a language hint (one of `yaml`, `bash`, `json`, `swift`, `kotlin`, `groovy`, `ruby`, `dart`, `diff` — those are the languages our Prism config loads). +- Blocks: triple backticks with a language hint. `docusaurus.config.ts` adds `yaml`, `bash`, `json`, `swift`, `kotlin`, `groovy`, `ruby`, `dart`, `diff` on top of the languages `prism-react-renderer` bundles (among others `javascript`, `typescript`, `xml`, `go`, `python`). Use `text` for plain text, such as file names. - **Don't put code blocks inside admonitions.** Render the admonition first, then the code block as a sibling. **Showing a change to an existing file** diff --git a/docs/bitrise-ci/testing/deploying-and-viewing-test-results.mdx b/docs/bitrise-ci/testing/deploying-and-viewing-test-results.mdx index f724525b..5bf47ad3 100644 --- a/docs/bitrise-ci/testing/deploying-and-viewing-test-results.mdx +++ b/docs/bitrise-ci/testing/deploying-and-viewing-test-results.mdx @@ -50,7 +50,7 @@ If you run your tests using other Steps (for example, you can use [Script](https :::important[Attachments and flaky tests] - If your tests generate attachments or you want Bitrise to show flaky tests, the **Deploy to Bitrise.io** Step must be of version 2.19.1 or newer. + If your tests generate attachments or you want Bitrise to show flaky tests, the **Deploy to Bitrise.io** Step must be of version 2.19.1 or newer. To link attachments by file name, it must be version 2.26.0 or newer: [Naming attachments after their test case](/bitrise-ci/testing/deploying-and-viewing-test-results#naming-attachments-after-their-test-case). ::: @@ -102,7 +102,269 @@ Currently, we support the following file formats for attachments: ::: -However, if your test doesn't generate an `xcresult` file, you can still achieve the same thing by generating a JUnit XML file and using Bitrise Steps: +If your tests don't generate an `xcresult` file, Bitrise can still show attachments under their test cases. There are two ways to link them: + +- Name each file after its test case: [Naming attachments after their test case](#naming-attachments-after-their-test-case). +- Reference each file in the JUnit XML: [Referencing attachments in the JUnit XML](#referencing-attachments-in-the-junit-xml). + +### Naming attachments after their test case + +Name a screenshot, recording, or log after the test case that produced it, and Bitrise shows it under that test on the **Tests** tab. You don't have to edit the JUnit XML or write a script that links the files. + +:::important[Step versions] + +Linking attachments by file name requires the **Deploy to Bitrise.io** Step version 2.26.0 or newer. If you export your test results with the **Export test results to Test Reports** Step, it must be version 1.3.0 or newer. + +::: + +The file name has the following structure: + +```text +__[__run]__