oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1package plan3test
2
3import (
4 "errors"
5 "testing"
6
7 "amadan.net/oficina/equipo/internal/equipo"
8)
9
10func TestCoordinatorRejectsUnavailableBinding(t *testing.T) {
11 f, _, p, b := coordinatorFixture(t)
12 f.exec(t, `UPDATE connections SET reports_json=json_set(reports_json,'$[0].Available',json('false'),'$[0].ReadIsolation',json('false')) WHERE id='codex'`)
13 _, err := f.Store.SaveCoordinatorBinding(ctx, owner, p.RunnerID, "codex", equipo.Mutation{RequestID: "offline-binding", Revision: b.Revision})
14 if !errors.Is(err, equipo.ErrUnavailable) {
15 t.Fatalf("unavailable binding accepted: %v", err)
16 }
17 current, err := f.Store.Coordinator(ctx, owner)
18 must(t, err)
19 if current.ConnectionID != b.ConnectionID || current.Generation != b.Generation {
20 t.Fatal("failed selection changed binding")
21 }
22}
23