mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
committed by
GitHub
parent
8f1b4fb061
commit
6683ad989a
@ -48,14 +48,12 @@ func TestWorkspaceBuild(t *testing.T) {
|
||||
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
|
||||
auditor.ResetLogs()
|
||||
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
|
||||
defer cancel()
|
||||
|
||||
_, err := client.WorkspaceBuild(ctx, workspace.LatestBuild.ID)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, auditor.AuditLogs(), 1)
|
||||
_ = coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
|
||||
// Create workspace will also start a build, so we need to wait for
|
||||
// it to ensure all events are recorded.
|
||||
require.Len(t, auditor.AuditLogs(), 2)
|
||||
require.Equal(t, auditor.AuditLogs()[0].Ip.IPNet.IP.String(), "127.0.0.1")
|
||||
require.Equal(t, auditor.AuditLogs()[1].Ip.IPNet.IP.String(), "127.0.0.1")
|
||||
}
|
||||
|
||||
func TestWorkspaceBuildByBuildNumber(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user