-
Notifications
You must be signed in to change notification settings - Fork 371
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
Fix channels with slashes regression #2926
Conversation
Does this also work with |
Line 667 is testing that, I think |
micromamba/tests/test_create.py
Outdated
helpers.create("-n", env_name, "pkgs/main/linux-64::python", "--dry-run") | ||
helpers.create("-n", env_name, "pkgs/main::python", "--dry-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.
I'm confused about this test. Is the first line supposed to succeed and not the second? Should both fail?
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.
Both should succeed with identical results, imo.
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 the regression we observed that pkgs/main/linux-64::xxx
was accepted because the last component of the "channel path" was a known subdir, but pkgs/main
failed because main
is not a known subdir.
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 the try: finally:
would prevent the test to fail when these commands fail, no?
Anyhow, you can omit the os.environ
reset. This is handled by pytest fixtures.
micromamba/tests/test_create.py
Outdated
@@ -652,6 +652,24 @@ def test_spec_with_channel_and_subdir(): | |||
) | |||
|
|||
|
|||
def test_spec_with_slash_in_channel(tmp_home, tmp_root_prefix): | |||
env_name = "myenv" | |||
try: |
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.
prefer with pytest.raises
for negative testing. If the create command succeed, the test will still pass.
I took the liberty to resolve my own comments and to rebase. |
Thanks @AntoinePrv |
* Fix channels with slashes regression * fix formatting * make the test isolated Co-authored-by: Antoine Prouvost <[email protected]> * Add more tests * Use pytest utilities for negative testing * Add extra test doc --------- Co-authored-by: Antoine Prouvost <[email protected]>
* Allow defaults::* spec (#2927) * return architecture levels for micromamba (#2921) * return architecture levels for micromamba * fix formatting * use function multiversioning only on x86 * fix formatting * update test * use __builtin_cpu_supports and check for more features Co-authored-by: Marcel Bargull <[email protected]> --------- Co-authored-by: Marcel Bargull <[email protected]> * Fix channels with slashes regression (#2926) * Fix channels with slashes regression * fix formatting * make the test isolated Co-authored-by: Antoine Prouvost <[email protected]> * Add more tests * Use pytest utilities for negative testing * Add extra test doc --------- Co-authored-by: Antoine Prouvost <[email protected]> * Fix for name change --------- Co-authored-by: Marcel Bargull <[email protected]> Co-authored-by: Antoine Prouvost <[email protected]>
Regression as mentioned in #2431 (comment)