Xcode Test Insights
Xcode test insights
Section titled “Xcode test insights”Tuist Test Insights gives you Xcode test analytics to monitor your test suite’s health by identifying slow tests or quickly understanding failed CI runs. As your test suite grows, it becomes increasingly difficult to spot trends like gradually slowing tests or intermittent failures. Tuist Test Insights provides you with the visibility you need to maintain a fast and reliable test suite.
With Test Insights, you can answer questions such as:
- Have my tests become slower? Which ones?
- Which tests are flaky and need attention?
- Why did my CI run fail?
To start tracking your tests, you can leverage the tuist inspect test command by adding it to your scheme’s test post-action:

In case you’re using Mise, your script will need to activate tuist in the post-action environment:
# -C ensures that Mise loads the configuration from the Mise configuration# file in the project's root directory.$HOME/.local/bin/mise x -C $SRCROOT -- tuist inspect testYour test runs are now tracked as long as you are logged in to your Tuist account. You can access your test insights in the Tuist dashboard and see how they evolve over time:

Apart from overall trends, you can also dive deep into each individual test, such as when debugging failures or slow tests on the CI:

Generated projects
Section titled “Generated projects”If you are using generated projects with custom schemes, you can set up post-actions for test insights:
let project = Project( name: "MyProject", targets: [ // Your targets ], schemes: [ .scheme( name: "MyApp", shared: true, buildAction: .buildAction(targets: ["MyApp"]), testAction: .testAction( targets: ["MyAppTests"], postActions: [ // Test insights: Track test duration and flakiness .executionAction( title: "Inspect Test", scriptText: """ $HOME/.local/bin/mise x -C $SRCROOT -- tuist inspect test """, target: "MyAppTests" ) ] ), runAction: .runAction(configuration: "Debug") ) ])If you’re not using Mise, your scripts can be simplified to:
testAction: .testAction( targets: ["MyAppTests"], postActions: [ .executionAction( title: "Inspect Test", scriptText: "tuist inspect test" ) ])Continuous integration
Section titled “Continuous integration”To track test insights on CI, you will need to ensure that your CI is
Additionally, you will either need to:
- Use the
command when invokingtuist xcodebuildxcodebuildactions. - Add
-resultBundlePathto yourxcodebuildinvocation.
When xcodebuild tests your project without -resultBundlePath, the required result bundle files are not generated. The tuist inspect test post-action requires these files to analyze your tests.