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

Function TestWorkspaceAgentLogText

codersdk/workspaceagents_test.go:58–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestWorkspaceAgentLogText(t *testing.T) {
59 t.Parallel()
60
61 ts := time.Date(2024, 1, 28, 10, 30, 0, 0, time.UTC)
62 log := codersdk.WorkspaceAgentLog{
63 CreatedAt: ts,
64 Level: codersdk.LogLevelInfo,
65 Output: "Agent started successfully",
66 SourceID: uuid.New(),
67 }
68 result := log.Text("main", "startup_script")
69 require.Equal(t, "2024-01-28T10:30:00Z [info] [agent.main|startup_script] Agent started successfully", result)
70}
71
72func TestWorkspaceAgentLogTextEmptySourceAndAgent(t *testing.T) {
73 t.Parallel()

Callers

nothing calls this directly

Calls 3

TextMethod · 0.95
NewMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected