MCPcopy Index your code
hub / github.com/coder/coder / newTestServer

Function newTestServer

coderd/x/chatd/chatd_test.go:5791–5811  ·  view source on GitHub ↗

newTestServer creates a passive server that never calls processOnce on its own.

(
	t *testing.T,
	db database.Store,
	ps dbpubsub.Pubsub,
	replicaID uuid.UUID,
)

Source from the content-addressed store, hash-verified

5789// newTestServer creates a passive server that never calls
5790// processOnce on its own.
5791func newTestServer(
5792 t *testing.T,
5793 db database.Store,
5794 ps dbpubsub.Pubsub,
5795 replicaID uuid.UUID,
5796) *chatd.Server {
5797 t.Helper()
5798
5799 logger := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true})
5800 server := chatd.New(chatd.Config{
5801 Logger: logger,
5802 Database: db,
5803 ReplicaID: replicaID,
5804 Pubsub: ps,
5805 PendingChatAcquireInterval: testutil.WaitLong,
5806 })
5807 t.Cleanup(func() {
5808 require.NoError(t, server.Close())
5809 })
5810 return server
5811}
5812
5813func TestPassiveServerDoesNotProcess(t *testing.T) {
5814 t.Parallel()

Calls 4

NewFunction · 0.92
HelperMethod · 0.65
CleanupMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected