mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 14:30:52 +00:00
test(domains): read the primary domain from default.env in every test
The hardcoded-primary-domain lint exempted tests/ and scripts/tests/, so test fixtures kept their own copy of the domain and would drift from INFINITO_DOMAIN the moment it changes. The lint now scans both trees, and a unit test pins its scope: only default.env, Markdown, inventories/, .claude/ and build/ may name the domain. Python tests take the value from default_domain_primary(), and the workspace helper builds its dashboard and Matomo URLs from INFINITO_DOMAIN once the repo .env is loaded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e8cb94e246
commit
e2beab9f1c
34 files changed
+371
-290
No files matched your search
+7
-4
@@ -16,8 +16,11 @@ import unittest
|
||||
from pathlib import Path
|
||||
|
||||
from utils.cache import _reset_cache_for_tests, base
|
||||
from utils.domains.default_primary import default_domain_primary
|
||||
from utils.paths import FILE_TOKENS
|
||||
|
||||
DOMAIN = default_domain_primary()
|
||||
|
||||
|
||||
def _write(path: Path, content: str) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
@@ -144,12 +147,12 @@ class TestStableVariablesSignature(unittest.TestCase):
|
||||
sig = base._stable_variables_signature(
|
||||
{
|
||||
"applications": {"web-app-x": {}},
|
||||
"DOMAIN_PRIMARY": "infinito.test",
|
||||
"SYSTEM_EMAIL_DOMAIN": "mail.infinito.test",
|
||||
"DOMAIN_PRIMARY": DOMAIN,
|
||||
"SYSTEM_EMAIL_DOMAIN": f"mail.{DOMAIN}",
|
||||
}
|
||||
)
|
||||
self.assertEqual(sig[2], "infinito.test")
|
||||
self.assertEqual(sig[3], "mail.infinito.test")
|
||||
self.assertEqual(sig[2], DOMAIN)
|
||||
self.assertEqual(sig[3], f"mail.{DOMAIN}")
|
||||
|
||||
|
||||
class TestTokensFileSignature(unittest.TestCase):
|
||||
|
||||
Reference in new issue
Block a user