Skip to content

Development

go-while edited this page Oct 23, 2026 · 2 revisions

Development

The repository is https://github.com/go-while/nntp-testkit. It has no dependencies outside the standard library, so there is no go.sum.

Path What
testkit.go the hang guard (Deadline)
client/ the strict client
fakeserver/ the fake server: server.go (options, script mode, faults), conn.go, store.go, generated.go (generated groups), storehandler.go, peer.go, tls.go
proc/ the process runner
conformance/ stub
example_test.go runnable examples; the first is copied in the README

Each package's doc.go holds its contract. Change it together with the code, and the tables in the README too.

Checks

gofmt -l . && go vet ./... && go test -race -count=1 ./...

CI runs go vet, go test -race and gofmt on every push and pull request (Linux and macOS, Go oldstable and stable).

Adding a behaviour

When a project needs a server behaviour the kit can't produce yet (a real server's quirk, a new fault):

  1. Add it as an option: StoreOptions for how the Store server answers, Faults for something that applies to any command's reply, Options for the connection level. The zero value must keep the old behaviour.
  2. Test it in the package, real-server behaviours in realworld_test.go.
  3. Describe it in doc.go and the README, and here in the wiki (Store and Groups, Faults, Real World Server Behaviours).
  4. Tag a release (below), then bump the version in the project that needs it and use the behaviour in its tests.

Before the tag, a project can test against a pushed branch with go get github.com/go-while/nntp-testkit@<commit> (a replace to a local checkout only works on the machine that has it).

Releasing

  1. Merge the work into main and push.
  2. Tag main with an annotated tag vX.Y.Z and a one-line summary, and push the tag.
  3. Add the version to Releases and Versioning and update the pages it changes.

Clone this wiki locally