Skip to content

Commit 84fd316

Browse files
committed
docs(provider-tck): say that the suite ships a control client
The README told an adopter to drive the control API and offered them the OpenAPI document to do it from, which was accurate while the client lived in the flagd adoption and is now misleading: the client ships here. The example is the real constructor signature, options struct and error and all. Writing it from memory produced a single-string call that does not compile, which is the failure mode a README example has -- nothing checks it, and the reader finds out instead of the author. Signed-off-by: Simon Schrottner <simon.schrottner@flagsmith.com>
1 parent 42901d7 commit 84fd316

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tools/provider-tck/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,23 @@ the normative contract for those providers, and it is what makes a conformance c
301301
another language's TCK drives the same endpoints against the same stack and must get the same
302302
answers.
303303

304+
You do not have to write the client. `tck.HTTPControl` is one, and it ships here rather than in an
305+
adoption precisely because every adoption needs the same one:
306+
307+
```go
308+
control, err := tck.NewHTTPControl(tck.HTTPControlOptions{
309+
BaseURL: fmt.Sprintf("http://localhost:%d", launchpad.MappedPort()),
310+
})
311+
```
312+
313+
`BaseURL` is the only required field, and it must be built from the **dynamically mapped** host port
314+
discovered after the stack is up — a stack under test must not pin host ports. `Configuration`
315+
defaults to `tck.DefaultConfiguration`, the one name Appendix F requires every backend under test to
316+
serve, and the one that serves the canonical flag set.
317+
318+
If you find yourself writing a control client of your own, that is a defect here rather than
319+
something for you to work around.
320+
304321
Two of its requirements are easy to get wrong:
305322

306323
- **Containers are never stopped or restarted mid-suite.** Unavailability is simulated *inside* the

0 commit comments

Comments
 (0)