summaryrefslogtreecommitdiffstats
path: root/test/schemas/negative_test/changelogs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
commitd964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2 (patch)
tree794bc3738a00b5e599f06d1f2f6d79048d87ff8e /test/schemas/negative_test/changelogs
parentInitial commit. (diff)
downloadansible-lint-d964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2.tar.xz
ansible-lint-d964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2.zip
Adding upstream version 6.13.1.upstream/6.13.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/schemas/negative_test/changelogs')
-rw-r--r--test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml4
-rw-r--r--test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md40
-rw-r--r--test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml8
-rw-r--r--test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md34
-rw-r--r--test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml4
-rw-r--r--test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md34
-rw-r--r--test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml2
-rw-r--r--test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md34
-rw-r--r--test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml2
-rw-r--r--test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md34
10 files changed, 196 insertions, 0 deletions
diff --git a/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml
new file mode 100644
index 0000000..2639e9a
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml
@@ -0,0 +1,4 @@
+---
+releases:
+ 1.0.0:
+ release_date: 01-01-2020 # invalid date format, must be ISO-8601 !
diff --git a/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md
new file mode 100644
index 0000000..72b4f96
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/invalid-date/changelogs/changelog.yaml.md
@@ -0,0 +1,40 @@
+# ajv errors
+
+```json
+[
+ {
+ "instancePath": "/releases/1.0.0/release_date",
+ "keyword": "pattern",
+ "message": "must match pattern \"\\d\\d\\d\\d-\\d\\d-\\d\\d\"",
+ "params": {
+ "pattern": "\\d\\d\\d\\d-\\d\\d-\\d\\d"
+ },
+ "schemaPath": "#/properties/release_date/pattern"
+ }
+]
+```
+
+# check-jsonschema
+
+stdout:
+
+```json
+{
+ "status": "fail",
+ "errors": [
+ {
+ "filename": "negative_test/changelogs/invalid-date/changelogs/changelog.yaml",
+ "path": "$.releases.1.0.0.release_date",
+ "message": "'01-01-2020' is not a 'date'",
+ "has_sub_errors": false
+ },
+ {
+ "filename": "negative_test/changelogs/invalid-date/changelogs/changelog.yaml",
+ "path": "$.releases.1.0.0.release_date",
+ "message": "'01-01-2020' does not match '\\\\d\\\\d\\\\d\\\\d-\\\\d\\\\d-\\\\d\\\\d'",
+ "has_sub_errors": false
+ }
+ ],
+ "parse_errors": []
+}
+```
diff --git a/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml
new file mode 100644
index 0000000..99632a4
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml
@@ -0,0 +1,8 @@
+---
+releases:
+ 1.0.0:
+ plugins:
+ lookup:
+ - name: reverse
+ description: Reverse magic
+ namespace: "foo" # namespace must be null for plugins and objects
diff --git a/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md
new file mode 100644
index 0000000..ef847c3
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml.md
@@ -0,0 +1,34 @@
+# ajv errors
+
+```json
+[
+ {
+ "instancePath": "/releases/1.0.0/plugins/lookup/0/namespace",
+ "keyword": "type",
+ "message": "must be null",
+ "params": {
+ "type": "null"
+ },
+ "schemaPath": "#/$defs/plugin-descriptions/items/properties/namespace/type"
+ }
+]
+```
+
+# check-jsonschema
+
+stdout:
+
+```json
+{
+ "status": "fail",
+ "errors": [
+ {
+ "filename": "negative_test/changelogs/invalid-plugin-namespace/changelogs/changelog.yaml",
+ "path": "$.releases.1.0.0.plugins.lookup[0].namespace",
+ "message": "'foo' is not of type 'null'",
+ "has_sub_errors": false
+ }
+ ],
+ "parse_errors": []
+}
+```
diff --git a/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml
new file mode 100644
index 0000000..72def5b
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml
@@ -0,0 +1,4 @@
+---
+- this is invalid
+- as changelog must be object (mapping)
+- not an array (sequence)
diff --git a/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md
new file mode 100644
index 0000000..5938944
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/list/changelogs/changelog.yaml.md
@@ -0,0 +1,34 @@
+# ajv errors
+
+```json
+[
+ {
+ "instancePath": "",
+ "keyword": "type",
+ "message": "must be object",
+ "params": {
+ "type": "object"
+ },
+ "schemaPath": "#/type"
+ }
+]
+```
+
+# check-jsonschema
+
+stdout:
+
+```json
+{
+ "status": "fail",
+ "errors": [
+ {
+ "filename": "negative_test/changelogs/list/changelogs/changelog.yaml",
+ "path": "$",
+ "message": "['this is invalid', 'as changelog must be object (mapping)', 'not an array (sequence)'] is not of type 'object'",
+ "has_sub_errors": false
+ }
+ ],
+ "parse_errors": []
+}
+```
diff --git a/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml
new file mode 100644
index 0000000..d08ebd0
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+releases: foo # <-- not a semver
diff --git a/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md
new file mode 100644
index 0000000..64c4665
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/no-semver/changelogs/changelog.yaml.md
@@ -0,0 +1,34 @@
+# ajv errors
+
+```json
+[
+ {
+ "instancePath": "/releases",
+ "keyword": "type",
+ "message": "must be object",
+ "params": {
+ "type": "object"
+ },
+ "schemaPath": "#/properties/releases/type"
+ }
+]
+```
+
+# check-jsonschema
+
+stdout:
+
+```json
+{
+ "status": "fail",
+ "errors": [
+ {
+ "filename": "negative_test/changelogs/no-semver/changelogs/changelog.yaml",
+ "path": "$.releases",
+ "message": "'foo' is not of type 'object'",
+ "has_sub_errors": false
+ }
+ ],
+ "parse_errors": []
+}
+```
diff --git a/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml
new file mode 100644
index 0000000..a97e4e2
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml
@@ -0,0 +1,2 @@
+---
+release: {} # <- unknown key, correct would be releases
diff --git a/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md
new file mode 100644
index 0000000..490bdbe
--- /dev/null
+++ b/test/schemas/negative_test/changelogs/unknown-keys/changelogs/changelog.yaml.md
@@ -0,0 +1,34 @@
+# ajv errors
+
+```json
+[
+ {
+ "instancePath": "",
+ "keyword": "additionalProperties",
+ "message": "must NOT have additional properties",
+ "params": {
+ "additionalProperty": "release"
+ },
+ "schemaPath": "#/additionalProperties"
+ }
+]
+```
+
+# check-jsonschema
+
+stdout:
+
+```json
+{
+ "status": "fail",
+ "errors": [
+ {
+ "filename": "negative_test/changelogs/unknown-keys/changelogs/changelog.yaml",
+ "path": "$",
+ "message": "Additional properties are not allowed ('release' was unexpected)",
+ "has_sub_errors": false
+ }
+ ],
+ "parse_errors": []
+}
+```