Other Test Frameworks
Last updated
Last updated
Trunk Flaky Tests is designed to be test framework agnostic. If you don't see a guide for your test framework, you can still use Flaky Tests. To use Flaky Tests, you will need to report test results in a format that Trunk understands and upload them to Trunk in CI. This guide will explain how to integrate your test framework with Trunk.
Trunk detects flaky tests by analyzing each test case's results over time. Trunk currently supports the JUnit XML and XCResult report formats. You will need to configure your test runner to report in one of these formats using a plugin or your own test result reporter.
Make sure your tests reports accurately report the file name, test name, and stack trace of each test result. Make sure the test names are not randomized. These details help Trunk better detect and display your test cases' health status.
You'll need to validate and upload the generated JUnit files to Trunk later during the setup process. Make sure the reports are generated with a consistent name and aren't cached or committed to Git.
Since you'll be generating JUnit reports using a new plugin or custom reporter, you should use the Trunk CLI to validate your results and fix any warnings or errors.
You can install the Trunk CLI locally like this:
Then, you can validate the results using the trunk flakytests validate
command like this:
You'll need to upload the JUnit reports generated by your CI jobs to Trunk so Trunk can detect flaky tests and report them to the dashboard. See CI Providers for a guide on how to upload test results to Trunk.