Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Nov 5, 2024
1 parent 4f43358 commit a744870
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<div class="col-start-2 hidden peer-checked:flex flex-col mt-2 bg-gray-100 p-2 gap-2">
<div class="flex items-center gap-2">
<label class="text-md" for="agent-pool-id">Agent pool</label>
<div hx-get="{{ poolsWorkspacePath .Workspace.ID }}?agent_pool_id={{ default "" .Workspace.AgentPoolID.String }}" hx-trigger="load" hx-swap="innerHTML"></div>
<div hx-get="{{ poolsWorkspacePath .Workspace.ID }}?agent_pool_id={{ default "" .Workspace.AgentPoolID }}" hx-trigger="load" hx-swap="innerHTML"></div>
</div>
<span class="description">Select an agent pool. If no pools are listed then you either need to create a pool or you need to configure at least one pool to grant access to your workspace. Manage agent pools <a id="agent-pools-link" class="underline" href="{{ agentPoolsPath .Workspace.Organization }}">here</a>.</span>
</div>
Expand Down
28 changes: 0 additions & 28 deletions internal/runner/job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,6 @@ import (
"github.com/stretchr/testify/assert"
)

func Test_jobSpecFromString(t *testing.T) {
tests := []struct {
spec string
want JobSpec
wantErr error
}{
{
spec: "run-grDQCjrQne1EUIGW/plan",
want: JobSpec{RunID: resource.ParseID("run-grDQCjrQne1EUIGW", Phase: "plan")},
},
{
spec: "grDQCjrQne1EUIGW/plan",
wantErr: ErrMalformedJobSpecString,
},
{
spec: "run-grDQCjrQne1EUIGW",
wantErr: ErrMalformedJobSpecString,
},
}
for _, tt := range tests {
t.Run(tt.spec, func(t *testing.T) {
got, err := jobSpecFromString(tt.spec)
assert.Equal(t, tt.wantErr, err)
assert.Equal(t, tt.want, got)
})
}
}

func TestJob_updateStatus(t *testing.T) {
tests := []struct {
name string
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func (h *webHandlers) deleteAgentPool(w http.ResponseWriter, r *http.Request) {
func (h *webHandlers) listAllowedPools(w http.ResponseWriter, r *http.Request) {
var opts struct {
WorkspaceID resource.ID `schema:"workspace_id,required"`
AgentPoolID resource.ID `schema:"agent_pool_id,required"`
AgentPoolID resource.ID `schema:"agent_pool_id"`
}
if err := decode.All(&opts, r); err != nil {
h.Error(w, err.Error(), http.StatusUnprocessableEntity)
Expand Down

0 comments on commit a744870

Please sign in to comment.