diff --git a/.dockerignore b/.dockerignore index 8cb6ad0a..d45eb263 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,4 +5,5 @@ venv *.bak *tree.json roles/list.json +*.pyc .git diff --git a/.gitignore b/.gitignore index c5bd2756..a3b87746 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# The .gitignore is the single point of truth for files which should be ignored. +# Add patterns, files and folders to the .gitignore and execute 'make build' +# NEVER TOUCH THE .dockerignore, BECAUSE IT ANYHOW WILL BE OVERWRITTEN + site.retry *__pycache__ venv @@ -5,3 +9,4 @@ venv *.bak *tree.json roles/list.json +*.pyc diff --git a/Dockerfile b/Dockerfile index 454cb6ad..6bf16e20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -60,6 +60,7 @@ RUN CMAIS_PATH=$(pkgmgr path cymais) && \ chmod +x /usr/local/bin/cymais # 10) Run integration tests +# This needed to be deactivated becaus it doesn't work with gitthub workflow #RUN CMAIS_PATH=$(pkgmgr path cymais) && \ # cd "$CMAIS_PATH" && \ # make test diff --git a/tests/unit/filter_plugins/test_get_role_folder.py b/tests/unit/filter_plugins/test_get_role_folder.py index 5af8f120..0f19dcb6 100644 --- a/tests/unit/filter_plugins/test_get_role_folder.py +++ b/tests/unit/filter_plugins/test_get_role_folder.py @@ -52,12 +52,11 @@ class TestGetRoleFolder(unittest.TestCase): self.assertIn(f"Roles path not found: {invalid_path}", str(cm.exception)) def test_invalid_yaml_raises(self): - # Create a role with invalid YAML - bad_role_path = os.path.join(self.roles_dir, 'badrole', 'vars') - os.makedirs(bad_role_path) + # Create a role with invalid YAML that matches the target application_id + bad_role_path = os.path.join(self.roles_dir, 'role1', 'vars') with open(os.path.join(bad_role_path, 'main.yml'), 'w') as f: - f.write("::: invalid yaml :::") - + f.write("::: invalid yaml :::") # corrupt existing main.yml + with self.assertRaises(AnsibleFilterError) as cm: get_role('app-123', roles_path=self.roles_dir) self.assertIn('Failed to load', str(cm.exception))