-
Notifications
You must be signed in to change notification settings - Fork 22
More flexible --test option #359
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
That is a bad change. When working with test zones you want to be able to run just the specific test case and nothing else. Secondly, with that change, if Basic fails completely no other test case is run, and that is not what we want when testing and creating test zones. I am against a change that makes it impossible to run just the selected test case. |
|
All I'm hearing is "no" and "bad". Is there anything about this proposal that you do like? Also, I'm trying to understand your objection here. AFAICT you're saying that when a user requests that a single test case is run on a domain that doesn't fulfill the requirements posed by Basic, the requested test case still needs to run. Is that correct? And if so, could you explain why this is important, because it's not obvious to me. |
It would be good to be able to exclude test cases without creating a new profile. It would be good to be able to select two or more test cases and they are run without overlap. Sometimes it is probably good that Basic is run before a selected test.
I want to see what happens in that test case for the test zone even when there are errors. And I want minimal output without the extra output from Basic when testing test zones. Sometimes I have to run with Give the possibility to run a test without adding Basic. If Basic is not in the profile, why should Basic still be run? The magic could rather be to put the Basic test cases in the profile first, if there are any. |
Ok. Yeah, I see how this could be very valuable in development contexts. And I also don't particularly like that Basic is forced. I have an idea of how we could simplify things in Engine in a way that supports this. I think I'll make a draft PR there too. I won't make any more updates to the code here before Engine is in a better shape to support it. But if anyone has more feedback on the direction of this PR, please let me know. Maybe it'll affect the updates in Engine. |
|
@mattias-p, is this still relevant or can it be closed now? |
|
This conflicts with #371 as well as some of its documentation improvement followups. I plan to rebase this PR once those things have been merged. It seems somewhat unreasonable to get this merged for 2024.2 so I postponed it. |
ecf71b3 to
b316e12
Compare
5ebbad5 to
7690a3c
Compare
7690a3c to
b536acf
Compare
|
I rebased this onto latest develop and fixed some typos added some unit tests. I also tightened some validations for sanity reasons, but that shouldn't have any effect on zonemaster-cli behavior. |
I read through the module documentation again and I agree there was some room for improvement. So I worked through it again. |
|
I've rebased onto current develop and also improved the documentation. Please review again. |
matsduf
left a comment
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.
This fine, but I have some comments on the documentation to make is clearer. The functions work well.
|
@matsduf, I applied your suggestions. Please review again. |
marc-vanderwal
left a comment
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.
Looks fine.
I’ve run the test suite through Devel::Cover and found a single line in TestCaseSet.pm that wasn’t covered by the test suite. Otherwise it’s 100% covered.
| } | ||
| } | ||
| else { | ||
| croak "Unrecognized operator '$op'"; |
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.
This line is the only thing not covered by the existing unit tests.
| } ## end for my $case ( @cases ) | ||
| }; ## end 'new' => sub | ||
|
|
||
| subtest 'apply_modifier' => sub { |
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.
There should be a test case checking whether there is a croak if passing an illegal modifier.
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
Co-authored-by: Mats Dufberg <mats.dufberg@iis.se>
|
I've rebased and added a unit test for invalid operators. The unit test is slightly messy, but I didn't know how to do it more cleanly. Please review again. |
|
Successfully release tested on Rocky Linux 9. Unit tests pass, and I did a few test runs with varying |
Purpose
This PR implements flexible command line overriding of which test cases to run from the command line.
Context
This is an extension to the improvements in Extend --test option to allow passing only a testcase #333.
Replaces Better performance when running specified test. Function to exclude tests #130. The point of that PR is to allow users to exclude test cases from the command line. This PR includes the same functionality using a different command line syntax.
Leverages Ability to run single testcase via test_zone() zonemaster-engine#1312 to properly handle the Basic test module (c.f. Better performance when running specified test. Function to exclude tests #130 (comment)).
Handles the interaction of
--testand--profilein accordance with Better performance when running specified test. Function to exclude tests #130 (comment).For what it's worth, the idea for this design came to me in a discussion about Refactoring of function Zonemaster::Engine::Test::run_one() zonemaster-engine#1294.
Changes
The set of values accepted by
--testis extended.Which test cases to include in the run is now controlled by setting the
test_casesprofile property and running Zonemaster::Engine->test_zone().When
--test=basicor--test=basic02is specified, and basic02 considers the domain too broken to test, a CANNOT_CONTINUE message is now emitted, whereas it wasn't emitted before this PR.Reviewing
Testing