Skip to content

Copy helpers internally #8476

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

Merged
merged 2 commits into from
Apr 11, 2025
Merged

Copy helpers internally #8476

merged 2 commits into from
Apr 11, 2025

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Apr 10, 2025

Until #8223 is fixed copy some helpers from
IntergrationTests/Source/IntegrationTests to
Test/_InternalTestSupport so we can re-use the functionality.

Related to: #8433
rdar://148248105

(cherry picked from commit e303b89)

Test with: swiftlang/swift#80717

Until swiftlang#8223 is fixed copy some helpers from
`IntergrationTests/Source/IntegrationTests` to
`Test/_InternalTestSupport` so we can re-use the functionality.

Related to: swiftlang#8433
rdar://148248105

(cherry picked from commit e303b89)
@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 10, 2025

swiftlang/swift#80717

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 10, 2025

@swift-ci test self hosted windows

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 10, 2025

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 10, 2025

@swift-ci test self hosted windows

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 11, 2025

@swift-ci test windows

@bkhouri
Copy link
Contributor Author

bkhouri commented Apr 11, 2025

This change was tested against the https://github.com/swiftlang/swift project in this swiftlang/swift#80717.

@bkhouri bkhouri enabled auto-merge (squash) April 11, 2025 12:45
@@ -0,0 +1,70 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

stray newline

Suggested change


extension Trait where Self == Testing.ConditionTrait {
/// Skip test if the host operating system does not match the running OS.
public static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self {
Copy link
Contributor

@MaxDesiatov MaxDesiatov Apr 11, 2025

Choose a reason for hiding this comment

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

Is this used anywhere outside of this package? In general we try to stick to more restrictive package if there's a need to use APIs in other modules of this same package. Otherwise there's a risk of accidentally and unnecessarily creating a public API that other packages may add as unintended and undesirable dependencies.

Suggested change
public static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self {
package static func requireHostOS(_ os: OperatingSystem, when condition: Bool = true) -> Self {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is currently a helper. Nothing is using it at the moment, but the plan it to has Swift Testing tests use this traits when a test requires a specific host OS.

@bkhouri bkhouri merged commit 1d48e0a into swiftlang:main Apr 11, 2025
6 checks passed
@bkhouri bkhouri deleted the t/main/copy_helpers branch April 11, 2025 17:26
pmattos added a commit that referenced this pull request Apr 12, 2025
shahmishal pushed a commit that referenced this pull request Apr 14, 2025
### Motivation:

Pull request #8476 was breaking SwiftPM builds in Xcode (i.e., the
_package resolution_ step):

<img
src="https://github.com/user-attachments/assets/2424e52c-1198-45c2-aa82-68c73ef5e9d6"
width=600/>

### Modifications:

This reverts commit 1d48e0a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants