Skip to content

Commit

Permalink
fix(ui): bad db query broke runner listing
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Jan 1, 2025
1 parent af87baa commit d86705c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{{ template "identifier" . }}
<div>
<span class="font-mono bg-gray-200 py-1 px-2 text-xs">{{ .Version }}</span>
<span class="font-mono bg-gray-200 py-1 px-2 text-xs">{{ if .IsAgent }}otf-agent{{ else }}otfd{{ end }}</span>
<span id="process-name" class="font-mono bg-gray-200 py-1 px-2 text-xs">{{ if .IsAgent }}otf-agent{{ else }}otfd{{ end }}</span>
<span class="font-mono bg-gray-200 py-1 px-2 text-xs">{{ .IPAddress }}</span>
</div>
</div>
Expand Down
29 changes: 29 additions & 0 deletions internal/integration/runners_ui_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package integration

import (
"testing"

"github.com/playwright-community/playwright-go"
"github.com/stretchr/testify/require"
)

// TestRunnersUI demonstrates managing runners via the UI
func TestRunnersUI(t *testing.T) {
integrationTest(t)

daemon, org, ctx := setup(t, nil)

browser.New(t, ctx, func(page playwright.Page) {
// go to org main menu
_, err := page.Goto(organizationURL(daemon.System.Hostname(), org.Name))
require.NoError(t, err)

// to list of runners
err = page.Locator("#runners > a").Click()
require.NoError(t, err)

// expect otfd server to be listed as one and only runner
err = expect.Locator(page.Locator(`#process-name`)).ToContainText(`otfd`)
require.NoError(t, err)
})
}
1 change: 1 addition & 0 deletions internal/sql/queries/runner.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ SELECT
AND j.status IN ('allocated', 'running')
) AS current_jobs
FROM runners a
LEFT JOIN agent_pools ap USING (agent_pool_id)
WHERE agent_pool_id IS NULL
ORDER BY last_ping_at DESC;

Expand Down
1 change: 1 addition & 0 deletions internal/sql/sqlc/runner.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d86705c

Please sign in to comment.