Tests: skip the tier-copy check before reading repo-root files

test_published_tier_copy_matches_role_defaults read membership/tiers.eom.json
from the repo root before checking whether the role checkout exists, so it
errored instead of skipping in the app-only image that
membership/compose.test.yaml builds. Check first, then read.

Refs DevOps/software-infrastructure#52

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 09:18:02 -05:00
co-authored by Claude Opus 5.5
parent 74fd1d89ce
commit fd22bc6815
@@ -83,10 +83,10 @@ class ServiceGroupLDAPIntegrationTests(TestCase):
class ServiceDisplayTests(TestCase):
def test_published_tier_copy_matches_role_defaults(self):
root = Path(__file__).absolute().parents[3]
tiers = json.loads((root / "membership/tiers.eom.json").read_text(encoding="utf-8"))
role = root.parent / "ansible-role-www/defaults/main.yml"
if not role.exists():
self.skipTest("Role checkout is not present in the application test image")
tiers = json.loads((root / "membership/tiers.eom.json").read_text(encoding="utf-8"))
import yaml
deployed = yaml.safe_load(role.read_text(encoding="utf-8"))["www_membership_tiers"]