-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[5.5] fix a bug in test discovery where tests define in extensions break the discovery #3435
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
Conversation
…e discovery (swiftlang#3433) motivation: less bugs, happier users changes: modify test discovery code to key of class name rather than blindly iterate over tetst rdar://58435666
@swift-ci please test |
stream <<< "import XCTest" <<< "\n" | ||
stream <<< "@testable import " <<< module <<< "\n" | ||
|
||
for klass in tests { | ||
for classTests in testsByClass { |
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.
Since this is now iterating over a dictionary instead of an array, should the keys be sorted here to avoid spurious differences in how the output file is emitted?
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.
do you mean so that the output won't cause unnecessary compiles? if so, I think this is a good idea but I would do that in a separate optimization PR on main, and let the fix through as-is in 5.5
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.
Yes, that's what I meant — just to always have stable outputs. Agreed that it can be done separately.
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.
@@ -74,8 +78,8 @@ final class TestDiscoveryCommand: CustomLLBuildCommand { | |||
return [\n | |||
""" | |||
|
|||
for klass in tests { | |||
stream <<< indent(8) <<< "testCase(\(klass.name).__allTests__\(klass.name)),\n" | |||
for className in testsByClass.keys { |
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.
Same question here about order.
bring #3433 to 5.5