//go:build integration package inventory import "testing" // **The store after release 6's migrations is still one today's controller (C5) can read** (issue 1945, review round 1): the // revert path puts C5 back, either by the witness or by the operator's want, and it reads the columns of the node row that // recorded a send (sent, sent_at, sent_bus_users, sent_builds, sent_epoch, sent_summary, sent_generation, sent_provisioning) // and the tables of the plans' machinery (build_gate, declaration_send, assignment_generation, duration). Release 6 reads // none of them any more and drops none: they go in a later milestone, once C5 has left the controller's five newest // fingerprints. Each query below is one C5 ran. func TestTheStoreAfterReleaseSixIsStillOneTheControllerOfBeforeCanRead(t *testing.T) { inv := ForTest(t) ctx := t.Context() if _, err := inv.AddNode(ctx, "anchor"); err != nil { t.Fatal(err) } for _, q := range []string{ `select sent, sequence, sent_at, sent_provisioning from node`, `select sent_bus_users, sent_builds, sent_epoch, sent_summary, sent_generation from node`, `select name, sent, sent_at from node order by name`, `select build from build_gate where verdict = 'failed'`, `select count(*) from declaration_send`, `select generation from assignment_generation`, `select kind, subject, ref, took_ms from duration`, } { if _, err := inv.store.Pool().Exec(ctx, q); err != nil { t.Errorf("a query of the controller of before no longer runs on the store: %s: %v", q, err) } } }