mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: Add stage to build logs (#577)
* feat: Add stage to build logs This adds a stage property to logs, and refactors the job logs cliui. It also adds tests to the cliui for build logs! * Fix comments
This commit is contained in:
@ -94,9 +94,7 @@ func TestPatchCancelProjectVersion(t *testing.T) {
|
||||
var err error
|
||||
version, err = client.ProjectVersion(context.Background(), version.ID)
|
||||
require.NoError(t, err)
|
||||
// The echo provisioner doesn't respond to a shutdown request,
|
||||
// so the job cancel will time out and fail.
|
||||
return version.Job.Status == codersdk.ProvisionerJobFailed
|
||||
return version.Job.Status == codersdk.ProvisionerJobCanceled
|
||||
}, 5*time.Second, 25*time.Millisecond)
|
||||
})
|
||||
}
|
||||
@ -274,6 +272,10 @@ func TestProjectVersionLogs(t *testing.T) {
|
||||
t.Cleanup(cancelFunc)
|
||||
logs, err := client.ProjectVersionLogsAfter(ctx, version.ID, before)
|
||||
require.NoError(t, err)
|
||||
log := <-logs
|
||||
require.Equal(t, "example", log.Output)
|
||||
for {
|
||||
_, ok := <-logs
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user