mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: send end of logs when dbfake completes job (#11402)
This commit is contained in:
+5
-3
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/coderd/database/dbfake"
|
||||
"github.com/coder/coder/v2/coderd/database/dbtestutil"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
"github.com/coder/coder/v2/provisioner/echo"
|
||||
"github.com/coder/coder/v2/provisionersdk/proto"
|
||||
@@ -412,10 +413,11 @@ func TestStart_Starting(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := testutil.Context(t, testutil.WaitShort)
|
||||
|
||||
client, db := coderdtest.NewWithDatabase(t, nil)
|
||||
store, ps := dbtestutil.NewDB(t)
|
||||
client := coderdtest.New(t, &coderdtest.Options{Pubsub: ps, Database: store})
|
||||
owner := coderdtest.CreateFirstUser(t, client)
|
||||
memberClient, member := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
|
||||
r := dbfake.WorkspaceBuild(t, db, database.Workspace{
|
||||
r := dbfake.WorkspaceBuild(t, store, database.Workspace{
|
||||
OwnerID: member.ID,
|
||||
OrganizationID: owner.OrganizationID,
|
||||
}).
|
||||
@@ -434,7 +436,7 @@ func TestStart_Starting(t *testing.T) {
|
||||
|
||||
pty.ExpectMatch("workspace is already starting")
|
||||
|
||||
_ = dbfake.JobComplete(t, db, r.Build.JobID).Do()
|
||||
_ = dbfake.JobComplete(t, store, r.Build.JobID).Pubsub(ps).Do()
|
||||
pty.ExpectMatch("workspace has been started")
|
||||
|
||||
_ = testutil.RequireRecvCtx(ctx, t, doneChan)
|
||||
|
||||
Reference in New Issue
Block a user