-
Notifications
You must be signed in to change notification settings - Fork 107
Fixes for pbench-clear-tools potholes #2618
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
Fixes for pbench-clear-tools potholes #2618
Conversation
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 change looks good. I've got a few comments (😱), most of which are small stuff and nits. However, I think you need to rework the support for the "Tool not found" message, and I think you removed a FIXME without fixing it. 🙂 Also, we should discuss whether to keep all the assertions in the unit tests (e.g., as "specification") or whether we should include just the ones that aren't redundant.
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
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 better. I have a few more nits and suggestions.
|
Hey @riya-17 I have no idea how Github decided to remove you from my reviewers when I clicked the re-review button for Dave and Webb (I might have clicked something wrong). Anyway added you back. |
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
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 looks generally good, but I got kind of lost trying to review the test cases.
I'm wondering if you would be amenable to replacing all or most of the cases (particularly the new ones) with either one or two parameterized tests. I believe that we should be able to capture and test all the various combinations using a single test (with parameterized expected results) or with two tests (one for successes and one for errors). I think this will ultimately be simpler to understand, or, at least, easier to see what we cover.
If we parameterize groups, remotes, and tools, and have the tests omit the switches when the values are empty, then I think we can test all the combinations in a single test. If we have a fixture which sets up the configuration to test against, then we can vary what the tool attempts, which I think will be a better way to exercise the CUT. And, for the failure case, we can request items which are not created by the fixture, and we can easily try them in various positions in the list.
If that seems like too much to take on, let me know, and I'll try to give the rest of the test cases a proper review.
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
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 need some clarity into the test configuration which these tests are running the tool against. As I comment below, setting it up to be table-driven would suffice; otherwise, we need a good docstring on the fixture.
I'm confused about how the test is validating the cases where we omit switches.
And, I have a few smaller suggestions.
Also, we still need to get rid of the is True and is False from the assert statements.
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
Alright, so is the resolution of this discussion is to fail and terminate (without doing anything) by inspecting the list for an empty element before we start the operation? Also for the "wrong name" option do we want to keep our approach as it is right now (we skip the wrong name parameter but raise an error value). I feel we can always revisit the script in future if we need to update the approach or if the users of the pbench agent weigh their preferences of handling it some other way. |
That satisfies me and it will earn Dave's acceptance, so, yeah, let's do that. 😀
I would vote yes on that, as I think doing anything more comprehensive will increase cost without producing sufficient value for it.
I agree, with one caveat: we don't want a future change in our behavior to break then-existent practice. So, for instance, if we reject spurious commas now, we could add tolerance for them later; however, if we tolerate them now, then later we cannot tighten up the interface without potentially breaking someone. But, we could potentially alter how we handle the bad-option-value case in the future (although, we would have to give it some thought). |
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
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 looks good to me...just some code quality suggestions.
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
lib/pbench/test/functional/agent/cli/commands/tools/test_clear_tools.py
Outdated
Show resolved
Hide resolved
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.
👍
Fixes issue #2337
--nameand--groupoption onpbench-clear-toolscommand.