-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Tests: Convert Run Command Tests to Swift Testing #8771
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
Tests: Convert Run Command Tests to Swift Testing #8771
Conversation
ca043ed
to
928132e
Compare
@swift-ci test |
cdf999c
to
e928ec6
Compare
@swift-ci test |
@swift-ci test windows |
e928ec6
to
7572ef6
Compare
@swift-ci test |
@swift-ci test windows |
7572ef6
to
90ef1a8
Compare
@swift-ci test |
@swift-ci test windows |
Convert the Run Command Tests to Swift Testing. Make use of parameterized tests to reduce duplication and use withKnownIssue to get signal when tests have been fixed.
90ef1a8
to
e4d7187
Compare
@swift-ci test |
@swift-ci test windows |
1 similar comment
@swift-ci test windows |
@swift-ci test windows |
@@ -123,7 +123,7 @@ public let swiftTest: AbsolutePath = swiftpmBinaryDirectory.appending(component: | |||
|
|||
public let swiftRun: AbsolutePath = swiftpmBinaryDirectory.appending(component: "swift-run") | |||
|
|||
public let isSelfHosted: Bool = { | |||
public let runningInSelfHostedPipeline: Bool = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: By detecting the specific CI job that these tests are running, it could be undermining real understanding of the reasons why tests are failing, and having specific detection mechanisms for those cases. Otherwise, this seems to be no better than just marking isIntermittent
on each withKnownIssue block. Also, it opens things up to intermittent failures if the job environment changes, such as an OS upgrade, or any other effect that makes these tests fail.
@@ -63,6 +63,14 @@ public let isRealSigningIdentitTestDefined = { | |||
#endif | |||
}() | |||
|
|||
public let duplicateSymbolRegex: Regex<AnyRegexOutput>? = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): Make this regex non-optional, and in the computed property allow it to throw. Then if this regex ever fails to compile for any reason, the test will throw an error with the details of why the regex failed to compile.
@Suite( | ||
.serialized, // to limit the number of swift executable running. | ||
.tags( | ||
Tag.TestSize.large, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: This is useful metadata to help understand the nature of the test suite.
.bug("https://github.com/swiftlang/swift-package-manager/issues/8602"), | ||
arguments: SupportedBuildSystemOnPlatform, | ||
) | ||
func productArgumentPassing( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Why drop the word "unknown" from the name of the test function? Shouldn't this be testUnknownProductAndArgumentPassing
?
XCTAssertMatch(error.stderr, .contains("error: no executable product named 'unknown'")) | ||
// swift-build-tool output should go to stderr. | ||
withKnownIssue { | ||
#expect(stderr.contains("Compiling")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: There is no GitHub issue raised related to the stderr containing this specific output. Can you add one and add a .bug()
reference to it?
} | ||
} when: { | ||
ProcessInfo.hostOperatingSystem == .windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: where is the .bug()
reference to the GitHub issue for this known issue with Windows?
func swiftRunSIGINT( | ||
buildSystem: BuildSystemProvider.Kind, | ||
) throws { | ||
try withKnownIssue("Seems to be flaky in CI", isIntermittent: true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
praise: This looks like a good way to mark a known intermittent issue. Is there a GitHub issue for this flaky test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, this looks good to me. I've posted some thoughts, suggestions, and questions.
Convert the Run Command Tests to Swift Testing.
Make use of parameterized tests to reduce duplication and use
withKnownIssue
to get signal when tests have been fixed.Depends on: #8714