8000 Merge remote-tracking branch 'origin/main' into notif-inbox/int-334 · coder/coder@d02609f · GitHub
[go: up one dir, main page]

Skip to content

Commit d02609f

Browse files
committed
Merge remote-tracking branch 'origin/main' into notif-inbox/int-334
2 parents 1f18eca + 4449931 commit d02609f

File tree

31 files changed

+1722
-769
lines changed

31 files changed

+1722
-769
lines changed

agent/agent.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,6 @@ func (a *agent) collectMetadata(ctx context.Context, md codersdk.WorkspaceAgentM
372372
// Important: if the command times out, we may see a misleading error like
373373
// "exit status 1", so it's important to include the context error.
374374
err = errors.Join(err, ctx.Err())
375-
376375
if err != nil {
377376
result.Error = fmt.Sprintf("run cmd: %+v", err)
378377
}

agent/agenttest/client.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"golang.org/x/exp/slices"
1616
"golang.org/x/xerrors"
1717
"google.golang.org/protobuf/types/known/durationpb"
18+
"google.golang.org/protobuf/types/known/emptypb"
1819
"storj.io/drpc/drpcmux"
1920
"storj.io/drpc/drpcserver"
2021
"tailscale.com/tailcfg"
@@ -170,6 +171,7 @@ type FakeAgentAPI struct {
170171
lifecycleStates []codersdk.WorkspaceAgentLifecycle
171172
metadata map[string]agentsdk.Metadata
172173
timings []*agentproto.Timing
174+
connections []*agentproto.Connection
173175

174176
getAnnouncementBannersFunc func() ([]codersdk.BannerConfig, error)
175177
getResourcesMonitoringConfigurationFunc func() (*agentproto.GetResourcesMonitoringConfigurationResponse, error)
@@ -338,12 +340,20 @@ func (f *FakeAgentAPI) BatchCreateLogs(ctx context.Context, req *agentproto.Batc
338340

339341
func (f *FakeAgentAPI) ScriptCompleted(_ context.Context, req *agentproto.WorkspaceAgentScriptCompletedRequest) (*agentproto.WorkspaceAgentScriptCompletedResponse, error) {
340342
f.Lock()
341-
f.timings = append(f.timings, req.Timing)
343+
f.timings = append(f.timings, req.GetTiming())
342344
f.Unlock()
343345

344346
return &agentproto.WorkspaceAgentScriptCompletedResponse{}, nil
345347
}
346348

349+
func (f *FakeAgentAPI) ReportConnection(_ context.Context, req *agentproto.ReportConnectionRequest) (*emptypb.Empty, error) {
350+
f.Lock()
351+
f.connections = append(f.connections, req.GetConnection())
352+
f.Unlock()
353+
354+
return &emptypb.Empty{}, nil
355+
}
356+
347357
func NewFakeAgentAPI(t testing.TB, logger slog.Logger, manifest *agentproto.Manifest, statsCh chan *agentproto.Stats) *FakeAgentAPI {
348358
return &FakeAgentAPI{
349359
t: t,

0 commit comments

Comments
 (0)
0