mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-02 07:47:58 +00:00
perf(applications_carrier): park the carriers outside the fact cache
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88d2b6ad09
commit
2fd480d2db
10 files changed
+372
-61
No files matched your search
+16
-1
@@ -21,7 +21,11 @@ from pathlib import Path
|
||||
from utils.cache import base as cache_base
|
||||
from utils.cache import tokens as cache_tokens
|
||||
from utils.cache import users as cache_users
|
||||
from utils.cache.carrier import USERS_RENDERED_FACT, merged_users_cache_key
|
||||
from utils.cache.carrier import (
|
||||
USERS_RENDERED_FACT,
|
||||
CarrierInvisibleError,
|
||||
merged_users_cache_key,
|
||||
)
|
||||
from utils.cache.reset import _reset_cache_for_tests
|
||||
from utils.cache.yaml import dump_yaml_str
|
||||
from utils.domains.default_primary import default_domain_primary
|
||||
@@ -739,6 +743,17 @@ class TestGetMergedUsersCarrierFact(unittest.TestCase):
|
||||
merged["rendered"]["foo"]["email"], "foo@example.org"
|
||||
)
|
||||
|
||||
def test_a_carrier_parked_only_in_the_fact_cache_fails_loudly(self):
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
roles = _seed_minimal_user_role(Path(tmp))
|
||||
variables = self._variables()
|
||||
self._park(roles, variables, {"foo": {"carried": True}})
|
||||
variables["ansible_facts"] = {
|
||||
USERS_RENDERED_FACT: variables.pop(USERS_RENDERED_FACT)
|
||||
}
|
||||
with self.assertRaises(CarrierInvisibleError):
|
||||
self._merged(roles, variables)
|
||||
|
||||
|
||||
class TestStoreSignature(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user