@@ -56,12 +56,10 @@ func TestStartupLogsWriter_Write(t *testing.T) {
56
56
{
57
57
Level : codersdk .LogLevelInfo ,
58
58
Output : "hello world" ,
59
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
60
59
},
61
60
{
62
61
Level : codersdk .LogLevelInfo ,
63
62
Output : "goodbye world" ,
64
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
65
63
},
66
64
},
67
65
},
@@ -74,32 +72,26 @@ func TestStartupLogsWriter_Write(t *testing.T) {
74
72
{
75
73
Level : codersdk .LogLevelInfo ,
76
74
Output : "" ,
77
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
78
75
},
79
76
{
80
77
Level : codersdk .LogLevelInfo ,
81
78
Output : "" ,
82
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
83
79
},
84
80
{
85
81
Level : codersdk .LogLevelInfo ,
86
82
Output : "hello world" ,
87
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
88
83
},
89
84
{
90
85
Level : codersdk .LogLevelInfo ,
91
86
Output : "" ,
92
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
93
87
},
94
88
{
95
89
Level : codersdk .LogLevelInfo ,
96
90
Output : "" ,
97
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
98
91
},
99
92
{
100
93
Level : codersdk .LogLevelInfo ,
101
94
Output : "goodbye world" ,
102
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
103
95
},
104
96
},
105
97
},
@@ -112,7 +104,6 @@ func TestStartupLogsWriter_Write(t *testing.T) {
112
104
{
113
105
Level : codersdk .LogLevelInfo ,
114
106
Output : "hello world" ,
115
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
116
107
},
117
108
},
118
109
},
@@ -126,12 +117,10 @@ func TestStartupLogsWriter_Write(t *testing.T) {
126
117
{
127
118
Level : codersdk .LogLevelInfo ,
128
119
Output : "hello world" ,
129
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
130
120
},
131
121
{
132
122
Level : codersdk .LogLevelInfo ,
133
123
Output : "goodbye world" ,
134
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
135
124
},
136
125
},
137
126
},
@@ -144,12 +133,10 @@ func TestStartupLogsWriter_Write(t *testing.T) {
144
133
{
145
134
Level : codersdk .LogLevelInfo ,
146
135
Output : "hello world" ,
147
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
148
136
},
149
137
{
150
138
Level : codersdk .LogLevelInfo ,
151
139
Output : "goodbye world" ,
152
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
153
140
},
154
141
},
155
142
},
@@ -162,17 +149,14 @@ func TestStartupLogsWriter_Write(t *testing.T) {
162
149
{
163
150
Level : codersdk .LogLevelInfo ,
164
151
Output : "hello world" ,
165
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
166
152
},
167
153
{
168
154
Level : codersdk .LogLevelInfo ,
169
155
Output : "\r " ,
170
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
171
156
},
172
157
{
173
158
Level : codersdk .LogLevelInfo ,
174
159
Output : "goodbye world" ,
175
- Source : codersdk .WorkspaceAgentLogSourceExternal ,
176
160
},
177
161
},
178
162
},
@@ -200,7 +184,7 @@ func TestStartupLogsWriter_Write(t *testing.T) {
200
184
got = append (got , log ... )
201
185
return nil
202
186
}
203
- w := agentsdk .StartupLogsWriter (tt .ctx , send , tt . source , tt .level )
187
+ w := agentsdk .StartupLogsWriter (tt .ctx , send , uuid . New () , tt .level )
204
188
for _ , s := range tt .writes {
205
189
_ , err := w .Write ([]byte (s ))
206
190
if err != nil {
@@ -290,7 +274,7 @@ func TestStartupLogsSender(t *testing.T) {
290
274
return nil
291
275
}
292
276
293
- sendLog , flushAndClose := agentsdk .LogsSender (patchLogs , slogtest .Make (t , nil ).Leveled (slog .LevelDebug ))
277
+ sendLog , flushAndClose := agentsdk .LogsSender (uuid . New (), patchLogs , slogtest .Make (t , nil ).Leveled (slog .LevelDebug ))
294
278
defer func () {
295
279
err := flushAndClose (ctx )
296
280
require .NoError (t , err )
@@ -360,7 +344,7 @@ func TestStartupLogsSender(t *testing.T) {
360
344
return nil
361
345
}
362
346
363
- sendLog , flushAndClose := agentsdk .LogsSender (patchLogs , slogtest .Make (t , nil ).Leveled (slog .LevelDebug ))
347
+ sendLog , flushAndClose := agentsdk .LogsSender (uuid . New (), patchLogs , slogtest .Make (t , nil ).Leveled (slog .LevelDebug ))
364
348
defer func () {
365
349
_ = flushAndClose (ctx )
366
350
}()
0 commit comments