-
Notifications
You must be signed in to change notification settings - Fork 22
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
Generators: testcase numbering #274
Conversation
I have no strong opinion. For completeness, I guess that if I wrote a problem like this: sample:
'1': graph --n 2 --m 1
'2': graph --n 3 --m 2
secret:
- 'paths':
- ...
- 'trees':
- ...
- 'undirected':
- ...
- 'directed':
- ... and 82 secret testcases (all specified as list items), I’d like the testcase names to be
and so on. (Because I want to think of the secret testcases as Trying to reengineer this rule, I’m in favour of your last rule. (In particular, separate counters for testcases and testgroups.) I think testgroups can be individually numbered per-parent. I admit I have no experience with more than two levels of nesting, the first of which is the never-numbered So to expand on your last example:
Note that evaluation order in testgroup |
Testcase numbering: I agree that globally unique numbers independent of testgroups make sense and are intuitive ✔️ Indeed the two orderings can interfere in a slightly non-intuitive way, but if that's acceptable, this does seem like a clean way to go about things. I'll try to implement it. |
@thorehusfeldt I've pushed an implementation for global testcase numbering to this pr (
Can you test as well? I had some issues earlier after renaming things and changing between named and numbered directories and such, but at least the ones I encountered are now fixed. |
Here’s a rewritten-to-use-generators problem that crashes gracelessly. (But that can’t be because of numbering.)
|
Here’s a minimal generator for the above problem that fails with
exactly when I remove the
|
A user story related to numbering is that I may have written a bunch of foo: generate_me 34
bar: generate_me 64
baz: generate_me 76 and then later change my mind to preferring numbered testcases by introducing dashes into my generator script: - foo: generate_me 34
- bar: generate_me 64
- baz: generate_me 76 Currently, this (correctly) triggers
but maybe there should be a more helpful? In general, if a data directory includes both But I’m not sure. Maybe an attempt to provide a more plausible error message ("Testcase not listed (but numbered variant listed)") causes more confusion. |
Right, most of those warnings should be handled by the automatic removing of duplicate cases though. But around symlinks it's not super smooth yet i think |
Re the |
With this latest commit, changing from named to numbered or back and doing |
9218055
to
4af8be0
Compare
Zero-padding should work again -- there was a bug in counting the total number of testcases. |
308ae38
to
0e66769
Compare
Another suggestion for better warnings: when I add a new testcase in the middle of a numbered list I already generated, I get a confusing list of “duplicate rule” ERRORS like this:
or
This seems overly dramatic for an innocuous change that merely renumbers existing cases and requires a lot of I’m not sure what the user experience should be, but currently there is big difference between editing generators with many numbered or many unnumbered cases. |
Right, let's make it so that this The |
|
This follows from the discussion in #262 (particularly #262 (comment)).
To ensure that included testcases (from other testgroups/directories) are run in order, they must be numbered with a lower number. Kattis and/or problemtools automatically dedup testcases with the same name, so we can not 'renumber' testcases once they are included into a different directory.
This somewhat implies the need for a global numbering of testcases.
Also, note that yaml explicitly specified that directories are unordered, and hence in these cases we use alphabetical order (not the order as specified in the file).
We could number in a few ways:
in-order
:Non-numbered testgroups/testcases can be parents of numbered ones that are just skipped in the global numbering. I don't think that should cause complications.
I think this last option is quite reasonable.