D50 = A (R-1290): the published gate asserts the newest 5 released versions plus the pinned MinAgent (0.158.1) and day-0 agent (0.165.0); a pin with no tag fails; decoys red-proved. No binary change.
gates / gates (push) Successful in 1m41s
gates / gates (push) Successful in 1m41s
This commit is contained in:
@@ -179,13 +179,24 @@ def published_cases(base):
|
||||
TAGS = ["v0.150.%d" % i for i in range(3)] # inside any retention window >= 3
|
||||
VERS = [t[1:] for t in TAGS]
|
||||
|
||||
# D50 = A: the gate also asserts the PINNED versions. The decoys run against their own policy file (the real pins
|
||||
# name versions the fake Gitea does not hold); PINS is what each case writes there.
|
||||
pol_dir = tempfile.mkdtemp(prefix="retention-decoy-")
|
||||
pol = os.path.join(pol_dir, "retention-policy.json")
|
||||
PINS = {}
|
||||
|
||||
def case(name, setup, expect_rc, must=()):
|
||||
FAKE.reset()
|
||||
FAKE.tags = list(TAGS)
|
||||
FAKE.packages = set(VERS)
|
||||
FAKE.raw = set(VERS)
|
||||
PINS.clear()
|
||||
setup()
|
||||
rc, out = run([sys.executable, gate], ROOT, child_env(base))
|
||||
with io.open(pol, "w", encoding="utf-8") as fh:
|
||||
json.dump({"generic_versions_kept": keep, "pinned": dict(PINS)}, fh)
|
||||
env = child_env(base)
|
||||
env["FELHOM_RETENTION_POLICY"] = pol
|
||||
rc, out = run([sys.executable, gate], ROOT, env)
|
||||
if not FAKE.hits:
|
||||
fails.append("published/%s: the gate never asked the fake Gitea - the seam is not wired" % name)
|
||||
report("published: " + name, rc, out, expect_rc, must)
|
||||
@@ -220,6 +231,25 @@ def published_cases(base):
|
||||
case("BY DESIGN: a version older than the retention window is not asserted", retired, 0,
|
||||
("NOT ASSERTED", "0.9.0"))
|
||||
|
||||
def pinned_old_ok():
|
||||
FAKE.tags = ["v0.8.0"] + ["v0.10.%d" % i for i in range(keep)]
|
||||
FAKE.packages = set(t[1:] for t in FAKE.tags)
|
||||
FAKE.raw = set(t[1:] for t in FAKE.tags)
|
||||
PINS["hub_min_agent"] = "0.8.0"
|
||||
case("GENUINE (D50): a pinned version older than the window is asserted and downloads", pinned_old_ok, 0,
|
||||
("verifying: 0.8.0", "ALL RELEASED VERSIONS INSTALLABLE"))
|
||||
|
||||
def pinned_old_gone():
|
||||
pinned_old_ok()
|
||||
FAKE.packages.discard("0.8.0")
|
||||
case("FACT (D50): a pinned version older than the window whose package 404s", pinned_old_gone, 1,
|
||||
("FAIL v0.8.0", "binary NOT downloadable"))
|
||||
|
||||
def pinned_no_tag():
|
||||
PINS["day0_agent"] = "0.150.9"
|
||||
case("FACT (D50): a pin that names a version with no tag", pinned_no_tag, 1,
|
||||
("FAIL pinned day0_agent=0.150.9", "no git tag"))
|
||||
|
||||
def five_hundred():
|
||||
FAKE.tags_status = 500
|
||||
case("INCONCLUSIVE: the tags api answers 500", five_hundred, 2, ("INCONCLUSIVE",))
|
||||
|
||||
Reference in New Issue
Block a user