Skip to content

Commit

Permalink
fix: Add example to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Sep 8, 2024
1 parent bd1a50e commit 99bc1a6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 42 deletions.
110 changes: 68 additions & 42 deletions examples/values.schema.json
Original file line number Diff line number Diff line change
@@ -1,150 +1,176 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"global": {
"description": "Global values are values that can be accessed from any chart or subchart by exactly the same name.",
"required": [],
"title": "global",
"type": "object"
},
"service": {
"additionalProperties": true,
"properties": {
"conf": {
"additionalProperties": false,
"examples": [
"API_PROVIDER_ONE: api-key-x",
"EMAIL_ADMIN: [email protected]"
],
"patternProperties": {
"^API_.*": {
"pattern": "^api-key",
"required": [],
"type": "string"
},
"^EMAIL_.*": {
"format": "idn-email",
"required": [],
"type": "string"
}
},
"required": [],
"title": "conf",
"type": "object",
"examples": [
"API_PROVIDER_ONE: api-key-x",
"EMAIL_ADMIN: [email protected]"
]
"type": "object"
},
"contact": {
"default": "",
"format": "idn-email",
"title": "contact",
"examples": [
"[email protected]"
]
],
"format": "idn-email",
"required": [],
"title": "contact"
},
"enabled": {
"default": "true",
"default": true,
"description": "Type will be parsed as boolean",
"required": [],
"title": "enabled",
"type": "boolean"
},
"env": {
"additionalProperties": false,
"description": "Environment variables. If you want to provide auto-completion to the user ",
"properties": {
"ADMIN_EMAIL": {
"format": "idn-email",
"title": "ADMIN_EMAIL",
"type": "string",
"examples": [
"[email protected]"
]
],
"format": "idn-email",
"required": [],
"title": "ADMIN_EMAIL",
"type": "string"
},
"API_URL": {
"format": "idn-hostname",
"title": "API_URL",
"type": "string",
"examples": [
"https://api.example.org"
]
],
"format": "idn-hostname",
"required": [],
"title": "API_URL",
"type": "string"
},
"CONFIG_PATH": {
"description": "The local path to the service configuration file",
"title": "CONFIG_PATH",
"type": "string",
"examples": [
"/path/to/config"
]
],
"required": [],
"title": "CONFIG_PATH",
"type": "string"
}
},
"description": "Environment variables. If you want to provide auto-completion to the user ",
"title": "env",
"type": "object"
"required": [],
"title": "env"
},
"hosts": {
"description": "Will give auto-completion for the below structure \nhosts: \n - name:\n url: my.example.org",
"items": {
"properties": {
"host": {
"properties": {
"url": {
"format": "idn-hostname",
"required": [],
"type": "string"
}
},
"required": [],
"type": "object"
}
},
"required": [],
"type": "object"
},
"description": "Will give auto-completion for the below structure \nhosts: \n - name:\n url: my.example.org",
"required": [],
"title": "hosts",
"type": "array"
},
"maintainer": {
"default": "[email protected]",
"const": "[email protected]",
"default": "[email protected]",
"required": [],
"title": "maintainer"
},
"name": {
"default": "",
"description": "Name of the deployed service. Defined in the schema annotation",
"title": "name",
"anyOf": [
{},
{
"pattern": "^foo-"
"required": []
},
{
"pattern": "^foo-",
"required": []
}
]
],
"default": "",
"description": "Name of the deployed service. Defined in the schema annotation",
"required": [],
"title": "name"
},
"port": {
"default": "80",
"minimum": 80,
"default": 80,
"maximum": 89,
"minimum": 80,
"required": [],
"title": "port",
"type": "integer"
},
"storage": {
"default": "10Gib",
"pattern": "^[1-9][0-9]*Gib$",
"title": "storage",
"type": "string",
"examples": [
"5Gib",
"10Gib",
"20Gib"
]
],
"pattern": "^[1-9][0-9]*Gib$",
"required": [],
"title": "storage",
"type": "string"
},
"telemetry": {
"default": true,
"required": [],
"title": "telemetry",
"type": "boolean"
},
"type": {
"default": "application",
"title": "type",
"enum": [
"application",
"controller",
"api"
]
],
"required": [],
"title": "type"
}
},
"title": "service",
"required": [
"enabled"
]
],
"title": "service"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
"required": [],
"type": "object"
}
3 changes: 3 additions & 0 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

rc=0

cp ../examples/values.yaml test_repo_example.yaml
cp ../examples/values.schema.json test_repo_example_expected.schema.json

for test_file in test_*.yaml; do
expected_file="${test_file%.yaml}_expected.schema.json"
generated_file="${test_file%.yaml}_generated.schema.json"
Expand Down

0 comments on commit 99bc1a6

Please sign in to comment.