-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow model/explore selection and exclusion in assert #235
Conversation
763de30
to
a7c0dfc
Compare
Closes #165.
a7c0dfc
to
23741ba
Compare
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
==========================================
- Coverage 89.90% 89.81% -0.10%
==========================================
Files 12 13 +1
Lines 1060 1060
==========================================
- Hits 953 952 -1
- Misses 107 108 +1
Continue to review full report at Codecov.
|
8668b0b
to
a2f00d3
Compare
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 all looks good to me. One comment in-line about parallelising the data test queries, but I think really it's probably something (if I have understood it correctly) that we should just create an issue for.
test_results: List[Dict[str, Any]] = [] | ||
for test in selected_tests: | ||
test_name = test["name"] | ||
model_name = test["model_name"] | ||
results = self.client.run_lookml_test( | ||
self.project, model=model_name, test=test_name | ||
) | ||
test_results.extend(results) | ||
|
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 don't think there's anything we can do about this, but this will kick them off sequentially, right?
In theory, if a whole model is going to be tested, we could test it in one go I think, which would get us a decrease in run time because Looker would kick them off simultaneously. I think to do this we'd have to change the selection logic though.
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.
Yeah, the most we could do with the endpoint would be to run them on a model level and then filter the results. Didn't seem worth the lift to me until there's demonstrated performance issues.
Closes #227, closes #165. Refactors the selection logic to use regex, making it much more concise and readable. Move the
--explores
and--exclude
arguments to the validator subparser.The architecture of this change means it's much more difficult to validate the selectors and exclusions passed in (for example, raising an error on
model_a/explore_c
to communicate thatexplore_c
doesn't exist). This isn't ideal, because it's nice to catch when people have typos in their args, for example.