From e545c080822c5fee363a39aff147507401adad0f Mon Sep 17 00:00:00 2001 From: Dai Ha Date: Fri, 4 Sep 2026 14:32:08 +0700 Subject: [PATCH] =?UTF-8?q?#323:=20pin=20the=20exclusion=20set=20=E2=80=94?= =?UTF-8?q?=20the=20coverage=20mechanism's=20own=20escape=20hatch,=20found?= =?UTF-8?q?=20by=20mutation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/ConfigRefProfileCoverageTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fleetd/src/test/java/dev/ltms/fleet/config/ConfigRefProfileCoverageTest.java b/fleetd/src/test/java/dev/ltms/fleet/config/ConfigRefProfileCoverageTest.java index cda5530..f7e8d61 100644 --- a/fleetd/src/test/java/dev/ltms/fleet/config/ConfigRefProfileCoverageTest.java +++ b/fleetd/src/test/java/dev/ltms/fleet/config/ConfigRefProfileCoverageTest.java @@ -153,6 +153,21 @@ class ConfigRefProfileCoverageTest { "ConfigRef.LAUNCH_SETTINGS_EXCLUDED names a component that does not exist on " + "FleetConfig.Profile — check for a typo: " + excluded); + // The exclusion set is this mechanism's own escape hatch, so it has to be pinned too. + // Found by mutation while verifying fleetd #323: moving autoCompactWindow and + // ideOpenCommand OUT of the comparison and INTO the exclusion set left the whole suite + // green — the loop below simply skips them, and the denominator assertion still balances. + // That is exactly the lazy move a failing coverage test invites, and it silently restores + // the #323 bug. Only ideProjectDir and worktreeGroup were saved by a behavioural test in + // ConfigRefTest; the other two had none. So: growing this set now requires editing this + // line as well, which is a visible, deliberate diff rather than a quiet one. + assertEquals(Set.of("weight", "maxLoad", "credentialId"), excluded, + "ConfigRef.LAUNCH_SETTINGS_EXCLUDED changed. A component belongs in it ONLY if it " + + "is read live off the config supplier, not baked into a launcher at " + + "startup. If you are adding one to silence this test, that is fleetd #323 " + + "happening again: compare it in sameLaunchSettings instead. If it really " + + "is read live, name where it is read and update this assertion."); + FleetConfig.Profile base = profileOf(BASE); List uncovered = new java.util.ArrayList<>(); int compared = 0;