newV2Session wires a supervisor.Session around two caller-supplied chunk channels. The caller pushes Chunks onto clientCh / destCh and closes them to drive the parser; the returned session's ClientStream and DestStream surface those channels as read-only FakeConns.
(t *testing.T, clientCh, destCh chan fakeconn.Chunk)
| 17 | // closes them to drive the parser; the returned session's ClientStream |
| 18 | // and DestStream surface those channels as read-only FakeConns. |
| 19 | func newV2Session(t *testing.T, clientCh, destCh chan fakeconn.Chunk) (*supervisor.Session, chan *models.Mock) { |
| 20 | t.Helper() |
| 21 | mocks := make(chan *models.Mock, 16) |
| 22 | sess := &supervisor.Session{ |
| 23 | ClientStream: fakeconn.New(clientCh, nil, nil), |
| 24 | DestStream: fakeconn.New(destCh, nil, nil), |
| 25 | Mocks: mocks, |
| 26 | Logger: zaptest.NewLogger(t), |
| 27 | Ctx: context.Background(), |
| 28 | ClientConnID: "test-client-conn", |
| 29 | DestConnID: "test-dest-conn", |
| 30 | } |
| 31 | return sess, mocks |
| 32 | } |
| 33 | |
| 34 | // dispatch calls the public RecordOutgoing boundary rather than the |
| 35 | // unexported V2 entry so the test exercises the same dispatch branch |
no test coverage detected