Implement subtest sections in input files#11
Conversation
|
@RaduBerinde do you think we should require |
(This is functionally a no-op.)
40060c0 to
d9e8321
Compare
RaduBerinde
left a comment
There was a problem hiding this comment.
I don't think we should require that duplication. But it should be allowed (if it isn't already) to follow up the directive with an arbitrary comment subtest end # foo
I'm a little worried folks will use subtest after subtest and that will be allowed, and maybe they'll add the subtest ends at the very end to fix the errors, not realizing they are all nested. I think it's a bit overkill to allow nested subtests, but if we want that we should require that the subtest name includes the parent (eg subtest foo/bar for subtest bar inside foo).
This commit removes the one-subtest-per-directive logic and replaces it by proper subtest support in the input DSL. A sub-test begins with `subtest <name>` and ends with `subtest end [<name>]`. - Sub-tests can be nested. However, the name of a nested sub-test must be prefixed by the name of the enclosing sub-test and a `/`. - The name is optional after `end`; if present, it must match the corresponding start directive. - Obviously "`end`" is not a valid name to start a subtest. For example: ``` subtest foo subtest foo/bar subtest end foo/bar subtest end ```
d9e8321 to
ba50173
Compare
It's not that easy to parse "comments until the end of a line" without a proper lexer, which is not there today. So instead I opted to let
Good idea. Done. It's also good to ease with filtering. |
Fixes #8.
This commit removes the one-subtest-per-directive logic and replaces
it by proper subtest support in the input DSL.
A sub-test begins with
subtest <name>and ends withsubtest end [<name>].be prefixed by the name of the enclosing sub-test and a
/.end; if present, it must match thecorresponding start directive.
end" is not a valid name to start a subtest.For example:
This will be used in cockroachdb/cockroach#42250.
This change is