MCPcopy Create free account
hub / github.com/coder/coder / TestLogWriter_Mainline

Function TestLogWriter_Mainline

provisioner/terraform/executor_internal_test.go:25–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func TestLogWriter_Mainline(t *testing.T) {
26 t.Parallel()
27
28 logr := &mockLogger{}
29 writer, doneLogging := logWriter(logr, proto.LogLevel_INFO)
30
31 _, err := writer.Write([]byte(`Sitting in an English garden
32Waiting for the sun
33If the sun don't come you get a tan
34From standing in the English rain`))
35 require.NoError(t, err)
36 err = writer.Close()
37 require.NoError(t, err)
38 <-doneLogging
39
40 expected := []*proto.Log{
41 {Level: proto.LogLevel_INFO, Output: "Sitting in an English garden"},
42 {Level: proto.LogLevel_INFO, Output: "Waiting for the sun"},
43 {Level: proto.LogLevel_INFO, Output: "If the sun don't come you get a tan"},
44 {Level: proto.LogLevel_INFO, Output: "From standing in the English rain"},
45 }
46 require.Equal(t, expected, logr.logs)
47}
48
49func TestOnlyDataResources(t *testing.T) {
50 t.Parallel()

Callers

nothing calls this directly

Calls 4

logWriterFunction · 0.70
WriteMethod · 0.65
CloseMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected