-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: replace colons with hyphens in charm names
Multi-base charms may have colons in their platform name. These get converted to hyphens because some environments don't allow colons in filenames. Signed-off-by: Callahan Kovacs <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[email protected]:amd64.charm | ||
[email protected]:amd64.charm | ||
[email protected]-amd64.charm | ||
[email protected]-amd64.charm | ||
test-charm_noble-amd64.charm |
2 changes: 1 addition & 1 deletion
2
tests/spread/smoketests/multi-base/one-platform/expected-charms.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[email protected]:amd64.charm | ||
[email protected]-amd64.charm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,16 +86,39 @@ def test_get_metadata(package_service, simple_charm: BasesCharm, metadata): | |
|
||
|
||
@pytest.mark.parametrize( | ||
("bases", "expected_name"), | ||
("build_plan", "expected_name"), | ||
[ | ||
( | ||
[SIMPLE_BUILD_BASE], | ||
pytest.param( | ||
[ | ||
BuildInfo( | ||
platform="distro-1-test64", | ||
build_on="riscv64", | ||
build_for="riscv64", | ||
base=BaseName("ubuntu", "24.04"), | ||
) | ||
], | ||
"charmy-mccharmface_distro-1-test64.charm", | ||
id="simple", | ||
), | ||
pytest.param( | ||
[ | ||
BuildInfo( | ||
platform="[email protected]:riscv64", | ||
build_on="riscv64", | ||
build_for="riscv64", | ||
base=BaseName("ubuntu", "24.04"), | ||
) | ||
], | ||
"[email protected]", | ||
id="multi-base", | ||
), | ||
], | ||
) | ||
def test_get_charm_path(fake_path, package_service, bases, expected_name): | ||
def test_get_charm_path(fake_path, package_service, build_plan, expected_name): | ||
fake_prime_dir = fake_path / "prime" | ||
package_service._build_plan = build_plan | ||
package_service._platform = build_plan[0].platform | ||
|
||
charm_path = package_service.get_charm_path(fake_prime_dir) | ||
|
||
assert charm_path == fake_prime_dir / expected_name | ||
|