Skip to content
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

More flexible --test option #359

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

mattias-p
Copy link
Member

@mattias-p mattias-p commented Nov 23, 2023

Purpose

This PR implements flexible command line overriding of which test cases to run from the command line.

Context

Changes

  • The set of values accepted by --test is extended.

  • The semantics are changed of repeated --test options. They used to be cumulative but now the last one takes precedence.

  • Which test cases to include in the run is now controlled by setting the test_cases profile property and running Zonemaster::Engine->test_zone().

How to test this PR

TBD

@mattias-p mattias-p changed the base branch from master to develop November 23, 2023 08:16
@matsduf
Copy link
Contributor

matsduf commented Nov 23, 2023

  • Before this PR CLI would call either test_zone, test_module or test_method in Zonemaster::Engine
    to run the test. After this PR CLI always calls test_zone and uses the test_cases profile property to
    control which tests are run. This means that the Basic tests are always included even when a single test case
    is specified.

  • Since the semantics of specifying a single test case or single test module is changed so that the Basic tests
    are included, an argument could be made that this is a breaking change, but I believe an argument could also
    be made that it's still just an addition.

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.

@mattias-p
Copy link
Member Author

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.

@matsduf
Copy link
Contributor

matsduf commented Nov 23, 2023

All I'm hearing is "no" and "bad". Is there anything about this proposal that you do like?

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.

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.

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 --level debug which gives many lines, which will be anymore if Basic is run.

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.

@mattias-p
Copy link
Member Author

mattias-p commented Nov 23, 2023

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 --level debug which gives many lines, which will be anymore if Basic is run.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants