Skip to content

Commit

Permalink
fixup! update auto generated code
Browse files Browse the repository at this point in the history
  • Loading branch information
reubenmiller committed Apr 2, 2024
1 parent fb0e73b commit 7572c6b
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 10 deletions.
19 changes: 16 additions & 3 deletions api/spec/json/applicationVersions.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
},
{
"description": "Get an application versions by name",
"command": "c8y applications versions list --application cockpit"
"command": "c8y applications versions list --application cockpit",
"assertStdOut": {
"json": {
"path": "r//application/applications/\\d+/versions$"
}
}
}
]
},
Expand Down Expand Up @@ -133,7 +138,8 @@
"go": [
{
"description": "Create a new application version",
"command": "c8y applications versions create --application 1234 --file ./myapp.zip --version \"2.0.0\""
"command": "c8y applications versions create --application 1234 --file \"./testdata/myapp.zip\" --version \"2.0.0\"",
"skipTest": true
}
]
},
Expand Down Expand Up @@ -273,7 +279,14 @@
"go": [
{
"description": "Replace application version's tags",
"command": "c8y applications versions update --application 1234 --version 1.0 --tag tag1,latest"
"command": "c8y applications versions update --application 1234 --version 1.0 --tag tag1,latest",
"assertStdOut": {
"json": {
"path": "/application/applications/1234/versions/1.0",
"body.tags.0": "tag1",
"body.tags.1": "latest"
}
}
}
]
},
Expand Down
11 changes: 10 additions & 1 deletion api/spec/yaml/applicationVersions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ commands:

- description: Get an application versions by name
command: c8y applications versions list --application cockpit
assertStdOut:
json:
path: r//application/applications/\d+/versions$

pathParameters:
- name: application
Expand Down Expand Up @@ -99,7 +102,8 @@ commands:
skipTest: true
go:
- description: Create a new application version
command: c8y applications versions create --application 1234 --file ./myapp.zip --version "2.0.0"
command: c8y applications versions create --application 1234 --file "./testdata/myapp.zip" --version "2.0.0"
skipTest: true
pathParameters:
- name: application
type: application_with_versions
Expand Down Expand Up @@ -201,6 +205,11 @@ commands:
go:
- description: Replace application version's tags
command: c8y applications versions update --application 1234 --version 1.0 --tag tag1,latest
assertStdOut:
json:
path: /application/applications/1234/versions/1.0
body.tags.0: tag1
body.tags.1: latest

pathParameters:
- name: application
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/applications/versions/create/create.auto.go

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

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
tests:
applications/versions_create_Create a new application version:
command: c8y applications versions create --application 1234 --file ./myapp.zip --version "2.0.0"
command: c8y applications versions create --application 1234 --file "./testdata/myapp.zip" --version "2.0.0"
exit-code: 0
skip: true
stdout:
json:
method: POST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tests:
stdout:
json:
method: GET
path: /application/applications/cockpit/versions
path: r//application/applications/\d+/versions$
applications/versions_list_Get application versions:
command: c8y applications versions list --application 1234 --pageSize 100
exit-code: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tests:
exit-code: 0
stdout:
json:
..#(body.tags="latest").body.tags: latest
..#(body.tags="tag1").body.tags: tag1
body.tags.0: tag1
body.tags.1: latest
method: PUT
path: /application/applications/1234/versions/1.0
2 changes: 1 addition & 1 deletion tests/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ create_devicecert () {
local name="$1"

c8y devicemanagement certificates get -n --id "$name" --silentStatusCodes 404 ||
c8y devicemanagement certificates create -n --name "$name" --file tests/testdata/trustedcert.pem
c8y devicemanagement certificates create -n --name "$name" --file tests/testdata/trustedcert.pem --silentStatusCodes 409 --silentExit
}

# Remove cache to avoid stale/invalid cache which makes debugging tests very difficult
Expand Down
1 change: 1 addition & 0 deletions tests/testdata/myapp.zip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dummycontents

0 comments on commit 7572c6b

Please sign in to comment.