Skip to main content

Overview

The tuist test command runs tests for your Tuist project. It generates the Xcode workspace if needed, builds the test targets, and executes the tests with comprehensive options for filtering and configuration.

Usage

tuist test [options] [scheme]

Options

--path
string
default:"."
The path to the directory that contains the project to be tested.
-p
string
Short form of --path.
--clean
boolean
default:"false"
Clean the project before testing it.
-c
boolean
Short form of --clean.
--no-upload
boolean
default:"false"
Don’t persist test results to the server for test selection.
-n
boolean
Short form of --no-upload.
--device
string
Test on a specific device.
-d
string
Short form of --device.
--platform
string
Test on a specific platform (iOS, macOS, tvOS, visionOS, watchOS).
--os
string
Test with a specific version of the OS.
-o
string
Short form of --os.
--rosetta
boolean
default:"false"
Append arch=x86_64 to the destination to run the simulator in Rosetta mode.
--configuration
string
The configuration to be used when testing the scheme (e.g., Debug, Release).
-C
string
Short form of --configuration.
--skip-ui-tests
boolean
default:"false"
Skip testing UI Tests targets.
--skip-unit-tests
boolean
default:"false"
Skip testing Unit Tests targets.
--result-bundle-path
string
Path where test result bundle will be saved.
-T
string
Short form of --result-bundle-path.
--test-plan
string
The test plan to run.
--test-targets
string[]
The list of test identifiers you want to test. Expected format is TestTarget[/TestClass[/TestMethod]]. Applied before --skip-testing.
--skip-test-targets
string[]
The list of test identifiers you want to skip testing. Expected format is TestTarget[/TestClass[/TestMethod]].
--filter-configurations
string[]
The list of test plan configurations you want to test. Applied before --skip-configuration.
--skip-configurations
string[]
The list of test plan configurations you want to skip testing.
--no-binary-cache
boolean
default:"false"
Ignore binary cache and use sources only.
--no-selective-testing
boolean
default:"false"
Run all tests without using selective testing. By default, Tuist only runs tests affected by code changes.
--generate-only
boolean
default:"false"
Generate the project and skip testing. Useful for debugging purposes.
--without-building
boolean
default:"false"
Run the tests without building first.
--build-only
boolean
default:"false"
Build the tests but don’t run them.
--skip-quarantine
boolean
default:"false"
Disable the quarantine feature and run tests regardless of whether they are quarantined on the server.

Arguments

scheme
string
The scheme to be tested. By default, it tests all the testable targets of the project in the current directory.
--
string[]
Arguments after -- are passed through to xcodebuild. Example: tuist test -- -destination 'platform=iOS Simulator,name=iPhone 15' -parallel-testing-enabled YES

Examples

Run all tests

tuist test
Runs all testable targets in the current project.

Test specific scheme

tuist test MyAppTests
Runs tests for the MyAppTests scheme.

Clean test

tuist test --clean MyAppTests
Cleans and tests the MyAppTests scheme.

Test on specific device

tuist test --device "iPhone 15 Pro" MyAppTests
Runs tests on the iPhone 15 Pro simulator.

Skip UI tests

tuist test --skip-ui-tests
Runs only unit tests, skipping UI tests.

Test specific test cases

tuist test --test-targets MyTests/LoginTests/testValidLogin
Runs only the testValidLogin method in the LoginTests class.

Save test results

tuist test --result-bundle-path ./TestResults MyAppTests
Runs tests and saves the result bundle to ./TestResults.

Run with test plan

tuist test --test-plan MyTestPlan MyApp
Runs tests using the specified test plan.

Disable selective testing

tuist test --no-selective-testing
Runs all tests without selective testing optimization.

Selective testing

By default, Tuist uses selective testing to run only the tests affected by code changes. This significantly reduces test execution time in large projects. Use --no-selective-testing to disable this feature and run all tests.

Test quarantine

Tuist can automatically quarantine flaky tests to prevent them from blocking your CI pipeline. Use --skip-quarantine to disable this feature and run all tests including quarantined ones.

Subcommands

tuist test show

Show details about a specific test run.
tuist test show [test-run-id]

tuist test case

Manage individual test cases.
tuist test case [subcommand]