diff --git a/goodwe_controller/test_mqtt.py b/goodwe_controller/test_mqtt.py index e1b7183..5d44b92 100644 --- a/goodwe_controller/test_mqtt.py +++ b/goodwe_controller/test_mqtt.py @@ -272,11 +272,21 @@ print("\n1. the recorded baseline, and a roster of one") # entity on a live install. m, c, a = report("roster of one (`inverters:` empty, i.e. every install today)", announce(units=roster_names({}))) -check("⭐ AT THE SHIPPED ROSTER OF ONE EVERY ONE OF release/1.0's NINE " - "MESSAGES IS STILL BYTE-IDENTICAL AND STILL FIRST: same topics, same " +# ⚠️ THE HEADLINE SAYS EIGHT, NOT NINE, AND THE SLICE UNDER IT IS WHY. +# release/1.0 announces NINE messages; the ninth is `goodwe_ctl/availability`, +# which `_announce()` publishes LAST and which TEL-10 therefore MOVES - it is +# byte-identical but no longer at index 8. So what is asserted here is the eight +# entity CONFIGS, `[:len(BASELINE) - 1] == BASELINE[:-1]`, and the word "nine" +# above it named an assertion this file does not make. The ninth is not +# unguarded: the `== SITE_NOW` on the next check pins it byte-for-byte in its +# new last position. Two sentences, two checks. +check("⭐ AT THE SHIPPED ROSTER OF ONE EVERY ONE OF release/1.0's EIGHT ENTITY " + "CONFIGS IS STILL BYTE-IDENTICAL AND STILL FIRST: same topics, same " "unique_ids, same payload bytes, same retain flags, in the same order - " "no second device, no renamed entity, nothing re-ordered. TEL-10 adds " - "rows AFTER them; it may not move one of them", + "rows AFTER them; it may not move one of them. (release/1.0's NINTH " + "message, `availability`, is byte-identical too and deliberately moves " + "to LAST; the `== SITE_NOW` below is what pins it)", announce(units=roster_names({}))[:len(BASELINE) - 1] == BASELINE[:-1]) # ⚠️ AND THE ADDITION IS ITS OWN CLAIM, WITH A COUNT. "Nothing moved" and @@ -333,8 +343,10 @@ check("⭐ AC 1: AT A ROSTER OF TWO, EVERY ONE OF A's NINE MESSAGES IS STILL " (m, c) == ([], [])) check("...and the eight additions are all B's and A's own per-unit rows, and " "all of them are NEW topics", len(a) == 8) -check("...and A's nine messages are still the FIRST nine, in the same order, " - "so a broker replaying retained messages sees them unchanged", +check("...and A's eight entity configs are still the FIRST eight, in the same " + "order, so a broker replaying retained messages sees them unchanged " + "(the ninth, `availability`, is byte-identical and last - the check " + "above is the one that covers it, as a diff rather than a prefix)", TWO[:len(BASELINE) - 1] == BASELINE[:-1]) # ⚠️ THE SITE SET IS `SITE_NOW`, NOT `BASELINE`. Read from `BASELINE` it would diff --git a/goodwe_controller/test_telemetry.py b/goodwe_controller/test_telemetry.py index a41d52c..b93d9ce 100644 --- a/goodwe_controller/test_telemetry.py +++ b/goodwe_controller/test_telemetry.py @@ -32,11 +32,20 @@ the revert (MUTATION.md's reporting rules, and habit 18's unique backup path). M4 delete `self.loop_reason = "not-running"` -45 B 1 this file M5 delete the not-running branch's two zeroes -67 B 1 this file M6 `"loop_i": round(self.target, 1)` -2 B 4 this file - M7 the `loop_i` row deleted from `SENSORS` -96 B 8+1 test_mqtt + M7 the `loop_i` row deleted from `SENSORS` -96 B 10+1 test_mqtt + this file M8 `loop_i` announced PER INVERTER +89 B 8 test_mqtt M9 `loop_i` announced BEFORE release/1.0's nine +0 B 7 test_mqtt +⚠️ A RED COUNT IS A PROPERTY OF THE SUITE AS MUCH AS OF THE MUTATION, SO EVERY +ONE ABOVE NAMES A TREE - this one, at this commit. A later card that adds a +check, re-baselines one or deletes one moves the number with the mutation +untouched. Re-measure rather than inherit: `tools/mutation_run.sh` on a `cp -a` +of the tree, one file at a time, and say which tree. M7's count was written as +8 and is 10 on a re-run, on both trees - the direction was right and the count +was decoration, which is the half of MUTATION.md's reporting rule 3 that is +easiest to let rot. + ⚠️ M9 IS ZERO BYTES AND CHANGES NO PAYLOAD. Every id, name, unit and topic is identical; only the ORDER of the retained messages moves. No fingerprint and no byte delta can see it, which is why part 1 asserts the announcement as an