Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
golden
  • Loading branch information
mafredri committed Jan 2, 2025
commit c5a042996e62dd9e5e940609f6e19b6ef4e4b31b
16 changes: 16 additions & 0 deletions cli/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,22 @@ func TestCommandHelp(t *testing.T) {
Name: "coder users list",
Cmd: []string{"users", "list"},
},
clitest.CommandHelpCase{
Name: "coder provisioners list",
Cmd: []string{"provisioners", "list"},
},
clitest.CommandHelpCase{
Name: "coder provisioners list --output json",
Cmd: []string{"provisioners", "list", "--output", "json"},
},
clitest.CommandHelpCase{
Name: "coder provisioners jobs list",
Cmd: []string{"provisioners", "jobs", "list"},
},
clitest.CommandHelpCase{
Name: "coder provisioners jobs list --output json",
Cmd: []string{"provisioners", "jobs", "list", "--output", "json"},
},
))
}

Expand Down
3 changes: 3 additions & 0 deletions cli/testdata/coder_provisioners_jobs_list.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ID CREATED AT STATUS TAGS TYPE ORGANIZATION QUEUE
[version job ID] [timestamp] succeeded map[owner: scope:organization] template_version_import Coder
[workspace build job ID] [timestamp] succeeded map[owner: scope:organization] workspace_build Coder
44 changes: 44 additions & 0 deletions cli/testdata/coder_provisioners_jobs_list_--output_json.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"id": "[version job ID]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"status": "succeeded",
"worker_id": "[workspace build worker ID]",
"file_id": "[workspace build file ID]",
"tags": {
"owner": "",
"scope": "organization"
},
"queue_position": 0,
"queue_size": 0,
"organization_id": "[first org ID]",
"input": {
"template_version_id": "[version ID]"
},
"type": "template_version_import",
"organization_name": "Coder"
},
{
"id": "[workspace build job ID]",
"created_at": "[timestamp]",
"started_at": "[timestamp]",
"completed_at": "[timestamp]",
"status": "succeeded",
"worker_id": "[workspace build worker ID]",
"file_id": "[workspace build file ID]",
"tags": {
"owner": "",
"scope": "organization"
},
"queue_position": 0,
"queue_size": 0,
"organization_id": "[first org ID]",
"input": {
"workspace_build_id": "[workspace build ID]"
},
"type": "workspace_build",
"organization_name": "Coder"
}
]
2 changes: 2 additions & 0 deletions cli/testdata/coder_provisioners_list.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATED AT LAST SEEN AT NAME VERSION TAGS STATUS ORGANIZATION
[timestamp] [timestamp] test v0.0.0-devel map[owner: scope:organization] offline Coder
2 changes: 1 addition & 1 deletion cli/testdata/coder_provisioners_list_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
Columns to display in table output.

-o, --output table|json (default: table)
Expand Down
30 changes: 30 additions & 0 deletions cli/testdata/coder_provisioners_list_--output_json.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"id": "[workspace build worker ID]",
"organization_id": "[first org ID]",
"key_id": "00000000-0000-0000-0000-000000000001",
"created_at": "[timestamp]",
"last_seen_at": "[timestamp]",
"name": "test",
"version": "v0.0.0-devel",
"api_version": "1.1",
"provisioners": [
"echo"
],
"tags": {
"owner": "",
"scope": "organization"
},
"key_name": "",
"status": "offline",
"current_job": {
"id": "[version job ID]",
"status": "succeeded"
},
"previous_job": {
"id": "[workspace build job ID]",
"status": "succeeded"
},
"organization_name": "Coder"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@ OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

-c, --column [created at|name|tags] (default: created at,name,tags)
Columns to display in table output.

-o, --output table|json (default: table)
Output format.

———
Run `coder --help` for a list of global options.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ OPTIONS:
-O, --org string, $CODER_ORGANIZATION
Select which organization (uuid or name) to use.

-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
-c, --column [id|organization id|created at|last seen at|name|version|api version|tags|key name|status|current job id|current job status|previous job id|previous job status|organization] (default: name,organization,status,created at,last seen at,version,tags)
Columns to display in table output.

-o, --output table|json (default: table)
Expand Down