-
Notifications
You must be signed in to change notification settings - Fork 467
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
Tests for core
and cli
modules
#149
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.
Really nice, just got a few minor comments
current_saved_global_examples_repo.git.reset("--hard", "0.5.0") | ||
runner.invoke(pull, ["-f", "-v", "0.5.1"]) | ||
result = runner.invoke(list) | ||
assert "airflow_local" in result.output |
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.
Shouldn't this call raise an error somehow if the version does not exist?
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.
@schustmi I didn't understand this. Do you mean that we should add another test to catch this condition (i.e. if the version doesn't exist) or that the currently-written test is doing something unexpected?
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.
Not sure actually how this should be handled, maybe a warning message that the requested version does not exists and that we fallback to the latest one?
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.
@alex-zenml wdyt?
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've added a warning message.
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 is an incomplete review from a week ago or something. Its just two comments that I thought might still be relevant.
src/zenml/cli/example.py
Outdated
readme_content = git_examples_handler.get_example_readme(example_dir) | ||
click.echo(readme_content) | ||
except FileNotFoundError: | ||
error( |
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 might be a bit weird because maybe an example is there but doesnt have a README and it would say the example is not present
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.
Fixed now.
tests/cli/test_config.py
Outdated
assert "local_metadata_store" in result.output | ||
|
||
|
||
# test metadata register command actually registers a new metadata store |
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.
Are these all TODO's?
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.
Was leftover from an initial session thinking through the code. Removed now.
@schustmi back over to you now. I addressed all your comments. Thanks for the review. It's much better now thanks to them! |
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.
Nice! Just comments to remove some hanging comments otherwise LGTM!
src/zenml/cli/utils.py
Outdated
@@ -181,3 +184,14 @@ def parse_unknown_options(args: List[str]) -> Dict[str, Any]: | |||
assert len(p_args) == len(r_args), "Replicated arguments!" | |||
|
|||
return r_args | |||
|
|||
|
|||
# def markdown_to_console(markdown: str) -> None: |
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.
Should we take these out?
src/zenml/cli/utils.py
Outdated
@@ -21,6 +21,9 @@ | |||
|
|||
from zenml.core.base_component import BaseComponent | |||
|
|||
# from rich.console import Console |
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.
Should we take these out?
f"Example {example_name} is not one of the available options." | ||
f"\nTo list all available examples, type: `zenml example list`" | ||
) | ||
if path_utils.file_exists(example_dir) and path_utils.is_dir( |
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.
Nice!
@htahir1 done! I'll certainly return to the markdown parser feature. I added it and it works, but I couldn't figure out a good way to test it like we are now testing the non-parsed .md text. I'll add it to the backlog. So much more pleasant an experience compared to what we have currently. |
Cool! @schustmi can also take a look and merge then if he thinks everything is fixed :-) |
@schustmi LMK if this is what you were thinking about with some kind of warning/notification of the redownload. |
@alex-zenml Yes looks good! |
Pre-requisites
Please ensure you have done the following:
Types of changes
Describe changes
Add tests for
core
andcli
modulesSome tiny typos and bugs found in
src
fixed alongside.