Testing strategy

Tuist employs a diverse suite tests that help ensure it works as intended and prevents regressions as it continues to grow and evolve.

Acceptance Tests

Acceptance tests run the built tuist command line against a wide range of fixtures and verify its output and results. They are the slowest to run however provide the most coverage. The idea is to test a few complete scenarios for each major feature.

Those are written in Cucumber and Ruby and can be found in features. Those are run when calling bundle exec rake features. To run only a test, we can set the FEATURE environment variable:

# 32 is the line where the definition of the test starts
FEATURE=features/generate.feature:32 bundle exec rake features
Copy the content
Example

generate.features has several scenarios that run tuist generate on a fixture, verify Xcode projects and workspaces are generated and finally verify the generated project build and test successfully.

Unit Tests

Most of the internal components Tuist uses have unit tests to thoroughly test them. Here dependencies of components are mocked or stubbed appropriately to ensure tests are reliable, test only one component and are fast!

Those are written in Swift and follow the convention of <ComponentName>Tests. Those are run when calling swift test or from within Xcode.

Example:

Example

TargetLinterTests verifies all the different scenarios the target linter component can flag issues for.

Integration Tests

There’s a small subset of tests that test several components together as a whole to cover hard to orchestrate scenarios within acceptance tests or unit tests. Those stub some but not all dependencies depending on the test case and are slower than unit tests.

Those are written in Swift and are contained within the Tuist...IntegrationTests targets. Those are run when calling swift test or from within Xcode.

Example:

Example

StableStructureIntegrationTests dynamically generates projects with several dependencies and files in random orders and verifies the generated project is always the same even after several generation passes.

Tuist's logotype

Tuist

Documentation

Getting startedManifest specificationDependenciesContributors
Tuist © Copyright 2019. All rights reserved. Crafted with ♥ by Pedro Piñera & the contributors.

Other

GitHubSlackBlogReleases
Tuist © Copyright 2019. All rights reserved. Crafted with ♥ by Pedro Piñera & the contributors.