Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag to disable building with testablity when running tests #4119

Merged
merged 3 commits into from
Feb 11, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Feb 10, 2022

motivation: give users an option to build the tests without testability (testable imports). this can increase build / test cycles when tests do not require the testable imports feature, so build artifacts are more is cachable

changes:

  • add a --disable-testable-imports flag to swift test with which tests are build without the testability feature
  • always use -enable-testing when building test modules as it is required for test discovery
  • add tests

rdar://82448144

@@ -138,6 +138,10 @@ struct TestToolOptions: ParsableArguments {
@Option(help: "Test the specified product.")
var testProduct: String?

/// Generate LinuxMain entries and exit.
@Flag(name: .customLong("testable-imports"), inversion: .prefixedEnableDisable, help: "Enable or disable testable imports. Enabled by default.")
var enableTestableImports: Bool = true
Copy link
Contributor Author

@tomerd tomerd Feb 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the flag is --disable-testable-imports. ideas for a different name welcome. the user facing feature is testable imports so this is what I went with.

@tomerd
Copy link
Contributor Author

tomerd commented Feb 10, 2022

@swift-ci please smoke test

@tomerd tomerd changed the title add flag to allow disabling building with testablity when building tests add flag to disable building with testablity when running tests Feb 10, 2022
@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Feb 10, 2022
@tomerd
Copy link
Contributor Author

tomerd commented Feb 10, 2022

@swift-ci smoke test

@tomerd tomerd added WIP Work in progress and removed ready Author believes the PR is ready to be merged & any feedback has been addressed labels Feb 10, 2022
motivation: allow building tests without testability (testable imports), this can increase build / test cycles when tests do not require the testable imports feature since more is cachable

changes:
* add a --disable-testable-imports flag to "swift test" with which tests are build without the testablity feature
* add tests

rdar://82448144
@tomerd
Copy link
Contributor Author

tomerd commented Feb 11, 2022

@swift-ci please smoke test

@tomerd tomerd added ready Author believes the PR is ready to be merged & any feedback has been addressed and removed WIP Work in progress labels Feb 11, 2022
@tomerd tomerd merged commit b753bce into swiftlang:main Feb 11, 2022
tomerd added a commit that referenced this pull request Feb 14, 2022
motivation: keep change log up to date 

changes:
* add 5.7 section
* document user facing API changes in #4119
@tomerd tomerd mentioned this pull request Feb 14, 2022
tomerd added a commit that referenced this pull request Feb 14, 2022
motivation: keep change log up to date 

changes:
* add 5.7 section
* document user facing API changes in #4119
@elsh elsh mentioned this pull request Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to change log ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants