Skip to content

Commit 2a7cadd

Browse files
committed
chore: appease linter
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
1 parent e401764 commit 2a7cadd

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

coderd/workspaceagents_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,14 +1515,17 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
15151515
}).Do()
15161516

15171517
res := dbgen.WorkspaceResource(t, db, database.WorkspaceResource{JobID: r.Build.JobID})
1518-
agent := dbgen.WorkspaceAgent(t, db, database.WorkspaceAgent{ResourceID: res.ID})
1518+
agnt := dbgen.WorkspaceAgent(t, db, database.WorkspaceAgent{ResourceID: res.ID})
1519+
1520+
//nolint:gocritic // It's a test it's ok.
1521+
asSystemCtx := dbauthz.AsSystemRestricted(t.Context())
15191522

15201523
// It's simpler to call db.InsertWorkspaceApp directly than dbgen.WorkspaceApp because it's more terse and direct;
15211524
// the latter sets a bunch of defaults which make this test hard.
1522-
_, err := db.InsertWorkspaceApp(dbauthz.AsSystemRestricted(t.Context()), database.InsertWorkspaceAppParams{
1525+
_, err := db.InsertWorkspaceApp(asSystemCtx, database.InsertWorkspaceAppParams{
15231526
ID: uuid.New(),
15241527
Slug: "code-server",
1525-
AgentID: agent.ID,
1528+
AgentID: agnt.ID,
15261529
Icon: "/code.svg",
15271530
Command: sql.NullString{String: "some-command", Valid: true},
15281531
Url: sql.NullString{String: "http://localhost:3000", Valid: true},
@@ -1531,11 +1534,11 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
15311534
OpenIn: database.WorkspaceAppOpenInWindow,
15321535
})
15331536
require.NoError(t, err)
1534-
_, err = db.InsertWorkspaceApp(dbauthz.AsSystemRestricted(t.Context()), database.InsertWorkspaceAppParams{
1537+
_, err = db.InsertWorkspaceApp(asSystemCtx, database.InsertWorkspaceAppParams{
15351538
ID: uuid.New(),
15361539
Slug: "code-server-2",
15371540
DisplayName: "code-server-2",
1538-
AgentID: agent.ID,
1541+
AgentID: agnt.ID,
15391542
Icon: "/code.svg",
15401543
Command: sql.NullString{String: "some-command", Valid: true},
15411544
Url: sql.NullString{String: "http://localhost:3000", Valid: true},
@@ -1552,7 +1555,7 @@ func TestWorkspaceAgentAppHealth(t *testing.T) {
15521555
defer cancel()
15531556

15541557
agentClient := agentsdk.New(client.URL)
1555-
agentClient.SetSessionToken(agent.AuthToken.String())
1558+
agentClient.SetSessionToken(agnt.AuthToken.String())
15561559
conn, err := agentClient.ConnectRPC(ctx)
15571560
require.NoError(t, err)
15581561
defer func() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy