Skip to content

Commit 53005ea

Browse files
committed
update openapi and e2e test
1 parent 5c2e119 commit 53005ea

File tree

3 files changed

+41
-13
lines changed

3 files changed

+41
-13
lines changed

internal/api/docs/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,11 @@ components:
13201320
$ref: '#/components/schemas/AIModel'
13211321
nullable: true
13221322
type: array
1323+
config_variables:
1324+
items:
1325+
$ref: '#/components/schemas/BrickConfigVariable'
1326+
nullable: true
1327+
type: array
13231328
description:
13241329
type: string
13251330
id:
@@ -1340,6 +1345,9 @@ components:
13401345
variables:
13411346
additionalProperties:
13421347
$ref: '#/components/schemas/BrickVariable'
1348+
description: 'Deprecated: use config_variables instead. This field is kept
1349+
for backward compatibility.'
1350+
nullable: true
13431351
type: object
13441352
type: object
13451353
BrickInstance:

internal/e2e/client/client.gen.go

Lines changed: 16 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/e2e/daemon/brick_test.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ func TestBricksDetails(t *testing.T) {
127127
Name: f.Ptr("Person classification"),
128128
Description: f.Ptr("Person classification model based on WakeVision dataset. This model is trained to classify images into two categories: person and not-person."),
129129
}}
130+
expectConfigVariables := []client.BrickConfigVariable{
131+
{
132+
Name: f.Ptr("CUSTOM_MODEL_PATH"),
133+
Value: f.Ptr("/home/arduino/.arduino-bricks/ei-models"),
134+
Description: f.Ptr("path to the custom model directory"),
135+
Required: f.Ptr(false),
136+
},
137+
{
138+
Name: f.Ptr("EI_CLASSIFICATION_MODEL"),
139+
Value: f.Ptr("/models/ootb/ei/mobilenet-v2-224px.eim"),
140+
Description: f.Ptr("path to the model file"),
141+
Required: f.Ptr(false),
142+
},
143+
}
144+
130145
response, err := httpClient.GetBrickDetailsWithResponse(t.Context(), validBrickID, func(ctx context.Context, req *http.Request) error { return nil })
131146
require.NoError(t, err)
132147
require.Equal(t, http.StatusOK, response.StatusCode(), "status code should be 200 ok")
@@ -147,5 +162,7 @@ func TestBricksDetails(t *testing.T) {
147162
require.Equal(t, expectedUsedByApps, *(response.JSON200.UsedByApps))
148163
require.NotNil(t, response.JSON200.CompatibleModels, "Models should not be nil")
149164
require.Equal(t, expectedModelLiteInfo, *(response.JSON200.CompatibleModels))
165+
require.NotNil(t, response.JSON200.ConfigVariables, "ConfigVariables should not be nil")
166+
require.Equal(t, expectConfigVariables, *(response.JSON200.ConfigVariables))
150167
})
151168
}

0 commit comments

Comments
 (0)