-
Notifications
You must be signed in to change notification settings - Fork 0
#220 SLC UX Gen 2 #223
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
#220 SLC UX Gen 2 #223
Conversation
| if tag.startswith(f"{image_name}:{self.flavor}") | ||
| ] | ||
|
|
||
| def clean_all_images(self): |
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.
- Add prefix and rename method
- verify semantics of docker_tag_prefix
Proposal
flavors = (ScriptLanguageContainer.flavor_path,)
clean_flavor_images(
output_directory=str(self.workspace.output_path),
flavor=flavors
)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.
Done
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.
Maybe you will need to use
with current_directory(self.session.checkout_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.
I think we don't need with current_directory(self.session.checkout_dir):
Workspace.output_pathis definedself.root_dir / "output"ScriptLanguageContainer.__init__()initializes Workspace withWorkspace(Path.cwd())Path.cwd()returns an absolute path
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.
Some of the exaslct api calls which use the argument flavor_path unfortunately only wors if the flavor path is relative to the cloned repository. Maybe clean_flavor_images works with any directory, not sure.
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.
Please correct me if I'm wrong: flavor_path is still relative to the cloned directory:
@property
def flavor_path(self) -> Path:
return self.checkout_dir / constants.FLAVORS_PATH_IN_SLC_REPO / self.flavor|
|
||
|
|
||
| def expected_activation_key(slc: ScriptLanguageContainer) -> str: | ||
| alias = slc.language_alias |
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.
Hm, if we use the values from slc for testing, we don't actually test if they have the expected values. I mean, there could be something wrong with slc.language_alias. Wouldn't it be better if test for the real name? Or do we have already an unit test for property language_alias?
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.
The implementation of property is rather trivial:
@property
def language_alias(self) -> str:
return f"custom_slc_{self.name}"The actual value of the language alias IMHO is not important.
But, as talking about it, it comes to my mind that it should be unique, for example.
The correctness of the language alias is verified by integration test test_udf_with_custom_packages()
Please tell me, if you still request adding a unit test.
In this case, I will add verifying the uniqueness depending on the SLC's name.
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 will add a unit test.
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 added a unit test verifying the expected language_alias.
Co-authored-by: Thomas Ubensee <34603111+tomuben@users.noreply.github.com>
test/unit/slc/utest_slc.py
Outdated
| with slc_factory.context(sample_slc_name, flavor) as slc: | ||
| testee = slc |
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.
| with slc_factory.context(sample_slc_name, flavor) as slc: | |
| testee = slc | |
| with slc_factory.context(sample_slc_name, flavor) as testee: |
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.
In this case you need to add pass
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.
See last push.
|



Closes #220