refactor(e2e): move three more suites onto the harness - #2306
Conversation
watch-selector waits on pods by name rather than by selector, and fluentbit-hotreload asserts that a tag has not arrived, neither of which the harness could express.Env.Receiver replaces WaitForReceiverLogs and takes the tail with it: one value of 100, stricter than the 30 an absence check would otherwise get and no weaker for presence, since more lines only make a tag easier to find. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
206 lines to 81. The combined predicate becomes MustReceive(tagInfra) then MustNotReceive(tagTenant); the two agree on every ordering of the tags, and the split fails immediately rather than after five minutes. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
269 lines to 176, and the first caller of wait.SyslogNGAggregator. The SyslogNGSpec literal stays: its statefulset overrides and buffer volumes have no builder, and one caller does not justify inventing one.Two divergences change rather than survive. The poll interval was 2s and is now the shared 3s, and the aggregator check was cluster-wide and is now scoped to the one namespace this suite uses. Neither can change a verdict. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
226 lines to 159, and the first use of WithOperatorArgs. The Logging literal stays: fixture.WithFluentbit would add Network.Keepalive and WithFluentd would add Resources, BufferVolumeMetrics and Workers, none of which this suite has. Signed-off-by: Vyncint Ng <115854244+vyncint@users.noreply.github.com>
|
The migration itself looks right and I would take it. What I want to flag is what these three suites reveal about the layer below the harness, because two of them argue against the fixture design and I would rather settle that before nine more suites go through it. The harness is earning its keep. -248 lines here, -132 before, and it retired three bugs structurally rather than per suite: the teardown panic stranding a cluster, But The cause is its shape rather than its content. #2291's §6 lists nine fields where suites genuinely diverge. A defaulted builder over that much divergence is either wrong for most callers or needs an option per field, and neither saves anything. Suggestion: invert it to minimal rather than defaulted. That also answers the two literals you deliberately kept: under a minimal fixture they stop being exceptions and become the normal way a suite states its own spec. Thing that is not the fixture's problem, listed so it doesn't get folded in:
|
Three more suites onto the harness, and the three things they needed that it did not have.
fluentbit-hotreloadwatch-selectorsyslog-ng-aggregatorEach addition lands with a caller.
wait.SyslogNGAggregatorhad none until now, andwait.PodRunningstill has none by design — it is the escape hatch the named constructors fall back on.wait.Pod(namespace, name).watch-selectorwaits on two pods by name rather than by selector.Env.Receiver.MustReceiveandMustNotReceive, replacingWaitForReceiverLogs. The tail moves inside the type: one value of 100, which is stricter than the 30 an absence check would otherwise get and no weaker for presence, since more lines only make a tag easier to find.WithOperatorArgsalready existed and gets its first use inwatch-selector.What was left alone on purpose
watch-selectorkeeps itsLoggingliteral.fixture.WithFluentbit()would addNetwork.KeepaliveandWithFluentd()would addResources,BufferVolumeMetricsandWorkers: 2, none of which that suite has today.syslog-ng-aggregatorkeeps itsSyslogNGSpecfor the same reason: the statefulset overrides and buffer volumes have no builder, and one caller does not justify inventing one.fluentbit-hotreload's combined predicate is split,MustReceive(tagInfra)thenMustNotReceive(tagTenant). Worked through the three orderings — infra first, tenant first, tenant never — the two agree in every case; the split fails immediately rather than after five minutes, and says which half broke.Two divergences are changed rather than preserved, so they are stated rather than silent:
syslog-ng-aggregatorpolled at 2s and now polls at the shared 3s, and its aggregator check was cluster-wide and is now scoped to the one namespace it uses. Neither can change a verdict. Thesyslong_ng_aggregatorpackage typo is untouched; renaming belongs with the rest of the naming work.Verification
make checkpasses,golangci-lint run --max-same-issues=0 --max-issues-per-linter=0ine2e/reports 0 issues, and every commit builds, vets and tests on its own.Against real clusters:
syslog-ng-aggregator112s andwatch-selector64s both pass.fluentbit-hotreloaddoes not pass locally, and neither does the version on master. Same failure, same place, 4s apart: the tenant pipeline delivers nothing on this machine — 601 receiver deliveries alltag_infra, zerotag_tenant, against 605/0 for the unmigrated suite. So the migration is not the difference, but the local run is a before/after control rather than a pass. CI is the verdict for that one, where the suite has been green on six consecutive runs.