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

Skip to content

fix: make build table show empty instead of loading when none are recent #5666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion coderd/workspacebuilds.go
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,8 @@ func (api *API) convertWorkspaceBuilds(
templateVersionByID[templateVersion.ID] = templateVersion
}

var apiBuilds []codersdk.WorkspaceBuild
// Should never be nil for API consistency
apiBuilds := []codersdk.WorkspaceBuild{}
for _, build := range workspaceBuilds {
job, exists := jobByID[build.JobID]
if !exists {
Expand Down
2 changes: 2 additions & 0 deletions coderd/workspacebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ func TestWorkspaceBuilds(t *testing.T) {
)
require.NoError(t, err)
require.Len(t, builds, 0)
// Should never be nil for API consistency
require.NotNil(t, builds)

builds, err = client.WorkspaceBuilds(ctx,
codersdk.WorkspaceBuildsRequest{WorkspaceID: workspace.ID, Since: database.Now().Add(-time.Hour)},
Expand Down
3 changes: 2 additions & 1 deletion site/e2e/tests/basicFlow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { SignInPage } from "../pom"
import { clickButton, buttons, fillInput } from "../helpers"

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

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