Skip to content

Commit 1db2b12

Browse files
authored
chore: add a test to ensure audit code works with AGPL (#6561)
Fixes the regression seen in v0.19.1.
1 parent 7eb2c2f commit 1db2b12

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

enterprise/coderd/coderd_test.go

+21
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,27 @@ func TestAuditLogging(t *testing.T) {
204204
t.Logf("%T = %T", auditor, ea)
205205
assert.Equal(t, reflect.ValueOf(ea).Type(), reflect.ValueOf(auditor).Type())
206206
})
207+
// The AGPL code runs with a fake auditor that doesn't represent the real implementation.
208+
// We do a simple test to ensure that basic flows function.
209+
t.Run("FullBuild", func(t *testing.T) {
210+
t.Parallel()
211+
ctx, cancelFunc := testutil.Context(t)
212+
defer cancelFunc()
213+
client := coderdenttest.New(t, &coderdenttest.Options{
214+
Options: &coderdtest.Options{
215+
IncludeProvisionerDaemon: true,
216+
},
217+
})
218+
user := coderdtest.CreateFirstUser(t, client)
219+
workspace, agent := setupWorkspaceAgent(t, client, user, 0)
220+
conn, err := client.DialWorkspaceAgent(ctx, agent.ID, nil)
221+
require.NoError(t, err)
222+
defer conn.Close()
223+
connected := conn.AwaitReachable(ctx)
224+
require.True(t, connected)
225+
build := coderdtest.CreateWorkspaceBuild(t, client, workspace, database.WorkspaceTransitionStop)
226+
coderdtest.AwaitWorkspaceBuildJob(t, client, build.ID)
227+
})
207228
}
208229

209230
// testDBAuthzRole returns a context with a subject that has a role

0 commit comments

Comments
 (0)