-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
GSK-2617 Missing kwargs in a test make the whole suite fail #1748
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
01579e0
to
0ac0529
Compare
@@ -401,10 +401,6 @@ def run(self, verbose: bool = True, **suite_run_args): | |||
run_args.update(suite_run_args) | |||
|
|||
results: List[(str, TestResult, Dict[str, Any])] = list() | |||
required_params = self.find_required_params() | |||
undefined_params = {k: v for k, v in required_params.items() if k not in run_args} | |||
if len(undefined_params): |
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's the same check in to_unittest
that should be consistent with run
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.
why not keep the same check but convert an exception to a warning?
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.
Yes that's right, a warning make a lot more sense especially with live logs now
@andreybavt I updated the |
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.
I agree with the overall solution. +1 for early validation of required params, but it should not blockade the test suite being used, and it's worthwhile to still warn the user about it.
Feel free to commit or disregard my other nitpicks.
Co-authored-by: Jocelyn Vernay <[email protected]>
Co-authored-by: Jocelyn Vernay <[email protected]>
|
Description
Issue
When running a test suite, we do a validation that all the parameters have been set based on the typing annotation. (type is not
Optional
and no default value has been provided.The problem is that the whole test Suite is cancelled if only one test is "misconfigured", furthermore it might happen that a required parameter is actually optional but the typing is wrong.
Solution
The validation now show a warning instead of an exception and run the Suite letting the test fail.
How to reproduce
Here is a small snippet that run a Suite with missing param
Related Issue
Type of Change