Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 627fbe5

Browse files
authored
fix: make build table show empty instead of loading when none are recent (#5666)
* Fix builds to show empty instead of loading * Switch to backend fix * Increase e2e test timeout * Format
1 parent a5d39ad commit 627fbe5

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

coderd/workspacebuilds.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,8 @@ func (api *API) convertWorkspaceBuilds(
907907
templateVersionByID[templateVersion.ID] = templateVersion
908908
}
909909

910-
var apiBuilds []codersdk.WorkspaceBuild
910+
// Should never be nil for API consistency
911+
apiBuilds := []codersdk.WorkspaceBuild{}
911912
for _, build := range workspaceBuilds {
912913
job, exists := jobByID[build.JobID]
913914
if !exists {

coderd/workspacebuilds_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ func TestWorkspaceBuilds(t *testing.T) {
171171
)
172172
require.NoError(t, err)
173173
require.Len(t, builds, 0)
174+
// Should never be nil for API consistency
175+
require.NotNil(t, builds)
174176

175177
builds, err = client.WorkspaceBuilds(ctx,
176178
codersdk.WorkspaceBuildsRequest{WorkspaceID: workspace.ID, Since: database.Now().Add(-time.Hour)},

site/e2e/tests/basicFlow.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { SignInPage } from "../pom"
44
import { clickButton, buttons, fillInput } from "../helpers"
55

66
test("Basic flow", async ({ baseURL, page }) => {
7-
test.slow()
7+
// We're keeping entire flows in one test, which means the test needs extra time.
8+
test.setTimeout(120000)
89
await page.goto(baseURL + "/", { waitUntil: "networkidle" })
910

1011
// Log-in with the default credentials we set up in the development server

0 commit comments

Comments
 (0)