package altacompat import ( "testing" "amadan.net/oficina/alta/homeop" "amadan.net/oficina/alta/provision" "amadan.net/oficina/home/internal/home/directorydata" ) // homeop.CanonicalOrigin is Alta's copy of Home's closed registry of // canonical instances. It must agree with Home's at the pinned commit for // every app Alta knows and for names neither may admit: an app Alta adopts // that Home does not bind is a plan Home refuses, and the reverse is an // app Alta would never offer. func TestCanonicalOriginIsHomes(t *testing.T) { // ReservedLabels holds every app-like name (each app's, the suite's // and the platform's own), so a name added to either registry that // the other lacks fails here. names := append(provision.Slugs(), "", "Base", "base.oficina.works", "https://base.oficina.works") for label := range provision.ReservedLabels { names = append(names, label) } for _, app := range names { if got, want := homeop.CanonicalOrigin(app), directorydata.CanonicalOrigin(app); got != want { t.Errorf("CanonicalOrigin(%q): Alta %q, Home %q", app, got, want) } } if homeop.CanonicalOrigin("base") != "https://base.oficina.works" { t.Fatal("Base's canonical origin") } }