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
Make Configuration.TestFilter a pure-data type #358
Conversation
@swift-ci please test |
func apply(to testGraph: Graph<String, Test?>) -> Graph<String, Test?> { | ||
var result = _kind.apply(to: testGraph) | ||
func apply(to testGraph: Graph<String, Test?>) throws -> Graph<String, Test?> { | ||
var result = try Operation(_predicate).apply(to: testGraph) |
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 we ever need to separate Operation
from apply(to:)
? If not, can we just absorb the former into apply(to:)
?
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.
You mean e.g. inline Operation
enum into this function? I considered that but felt it would make the function body quite a bit more complicated. As it stands we're using access control to scope it pretty narrowly
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.
We could still split up the implementation into multiple functions/steps, but keep the interface simple.
@swift-ci please test |
Resolves rdar://126627664
92e8a0a
to
35624d5
Compare
@swift-ci please test |
@swift-ci please test |
This modifies the structure of
Configuration.TestFilter
so that it's a pure data type and is easier to become serializable.Motivation:
For easier integration with tools it would be helpful for the stored properties of
Configuration
to be serializable, or be trivially convertible to/from serializable types at least.Configuration
's nestedTestFilter
type currently includes a closure for filtering tests and is therefore cannot be serialized in its current form. This type doesn't really need to store a closure, however; it only needs to store information about how to perform filtering (e.g. data about criteria to match against), and later that can be interpreted when applying filtering.Modifications:
Configuration.TestFilter.Kind
enum so that its cases only store data, and no closures.Kind
type above to a newConfiguration.TestFilter.Operation
enum.Checklist:
Resolves rdar://126627664