Skip to content

Commit

Permalink
tests: remove stray template and fix init tests
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
  • Loading branch information
cmatsuoka committed Apr 22, 2024
1 parent 43a2181 commit 6b1bb65
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 43 deletions.
32 changes: 0 additions & 32 deletions charmcraft/templates/init-machine/tests/spread/lib/funcs.sh.j2

This file was deleted.

31 changes: 20 additions & 11 deletions tests/integration/commands/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,38 @@
"pyproject.toml",
"README.md",
"requirements.txt",
"spread.yaml",
"src",
"src/charm.py",
"tests",
"tests/integration",
"tests/integration/test_charm.py",
"tests/spread",
"tests/spread/lib",
"tests/spread/lib/cloud-init.yaml",
"tests/spread/lib/test-helpers.sh",
"tests/spread/general",
"tests/spread/general/integration",
"tests/spread/general/integration/task.yaml",
"tests/unit",
"tests/unit/test_charm.py",
"tox.ini",
)
)
BASIC_INIT_FILES_WITH_TOOLS = frozenset(
BASIC_INIT_FILES_WITH_SPREAD = frozenset(
list(BASIC_INIT_FILES)
+ [
pathlib.Path(p)
for p in (
"spread.yaml",
"tests/spread",
"tests/spread/lib",
"tests/spread/lib/cloud-config.yaml",
"tests/spread/lib/test-helpers.sh",
"tests/spread/general",
"tests/spread/general/integration",
"tests/spread/general/integration/task.yaml",
)
]
)
BASIC_INIT_FILES_WITH_TOOLS = frozenset(
list(BASIC_INIT_FILES_WITH_SPREAD)
+ [
pathlib.Path(p)
for p in (
"tests/spread/lib",
"tests/spread/lib/tools",
"tests/spread/lib/tools/retry",
)
Expand Down Expand Up @@ -115,7 +124,7 @@ def create_namespace(
("profile", "expected_files"),
[
pytest.param("simple", BASIC_INIT_FILES_WITH_TOOLS, id="simple"),
pytest.param("machine", BASIC_INIT_FILES, id="machine"),
pytest.param("machine", BASIC_INIT_FILES_WITH_SPREAD, id="machine"),
pytest.param("kubernetes", BASIC_INIT_FILES_WITH_TOOLS, id="kubernetes"),
],
)
Expand Down Expand Up @@ -225,7 +234,7 @@ def test_gecos_user_has_no_name(monkeypatch, new_path, init_command):
),
],
)
@pytest.mark.parametrize("expected_files", [BASIC_INIT_FILES])
@pytest.mark.parametrize("expected_files", [BASIC_INIT_FILES_WITH_TOOLS])
def test_create_directory(new_path, init_command, subdir, expected_files):
init_dir = new_path / subdir

Expand Down

0 comments on commit 6b1bb65

Please sign in to comment.