From 81d2d559f161026d7633a5c09d5e28fe3e2e5ebf Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 22 Jun 2021 22:02:59 +0100 Subject: Enforce all dicts with a fixed set of keys in test.json schema Improve test.json schema to disallow arbitrary keys in all dicts which have a defined set of keys (the 'installed', matrix 'options' and 'stdout' dicts). Add 'count' and 'comment' keys to 'stdout' dict. --- data/test.schema.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/test.schema.json b/data/test.schema.json index aa3cf8fec..43c1392c1 100644 --- a/data/test.schema.json +++ b/data/test.schema.json @@ -12,6 +12,7 @@ "type": "array", "items": { "type": "object", + "additionalProperties": false, "properties": { "file": { "type": "string" @@ -59,6 +60,7 @@ "type": "array", "items": { "type": "object", + "additionalProperties": false, "properties": { "val": { "type": "string" @@ -110,6 +112,7 @@ "type": "array", "items": { "type": "object", + "additionalProperties": false, "properties": { "line": { "type": "string" @@ -120,6 +123,12 @@ "literal", "re" ] + }, + "count": { + "type": "integer" + }, + "comment": { + "type": "string" } }, "required": [ -- cgit v1.2.3 From 5da355733113c6d61f22ff74c7e00fc65e01b253 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 22 Jun 2021 23:04:40 +0100 Subject: Fix test.json schema for 'matrix' I'm not sure what the current schema is describing, but it's not doing anything useful to validate 'matrix' entries, as I discover when I come to add something to that. 'matrix' is a dict with possible keys 'options' and 'exclude'. 'options' is a dict with arbitrary keys, whose's values are arrays Once we describe those dicts correctly, also fix that 'val' keys may be string, boolean or null, and the corresponding 'exclude' keys may be string or boolean. v2: Also allow 'val' and 'exclude' to be an array of strings. --- data/test.schema.json | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/data/test.schema.json b/data/test.schema.json index 43c1392c1..00c52aef6 100644 --- a/data/test.schema.json +++ b/data/test.schema.json @@ -54,16 +54,19 @@ }, "matrix": { "type": "object", - "additionalProperties": { - "properties": { - "options": { + "properties": { + "options": { + "additionalProperties": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "val": { - "type": "string" + "type": ["string", "boolean", "null", "array"], + "items": { + "type": "string" + } }, "compilers": { "type": "object", @@ -88,7 +91,10 @@ "items": { "type": "object", "additionalProperties": { - "type": "string" + "type": ["string", "boolean", "array"], + "items": { + "type": "string" + } } } } -- cgit v1.2.3 From 5c0cb0547bd52230faff322a33bfeac0eaaeea0d Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Tue, 22 Jun 2021 23:21:19 +0100 Subject: Fix test.json for boost test to match schema I guess the intent was that tests of thread/debug library variants only get run with MSVC, but currently this test isn't getting run at all in our Windows CI (since boost got removed from the VM image [1], and we didn't notice, more on which anon). [1] https://github.com/actions/virtual-environments/pull/2843 --- test cases/frameworks/1 boost/test.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test cases/frameworks/1 boost/test.json b/test cases/frameworks/1 boost/test.json index f4412d2ef..3145c80d2 100644 --- a/test cases/frameworks/1 boost/test.json +++ b/test cases/frameworks/1 boost/test.json @@ -7,10 +7,10 @@ ], "b_vscrt": [ { "val": null }, - { "val": "md", "compilers": { "cpp": [ "msvc" ] } }, - { "val": "mdd", "compilers": { "cpp": [ "msvc" ] } }, - { "val": "mt", "compilers": { "cpp": [ "msvc" ] } }, - { "val": "mtd", "compilers": { "cpp": [ "msvc" ] } } + { "val": "md", "compilers": { "cpp": "msvc" } }, + { "val": "mdd", "compilers": { "cpp": "msvc" } }, + { "val": "mt", "compilers": { "cpp": "msvc" } }, + { "val": "mtd", "compilers": { "cpp": "msvc" } } ] }, "exclude": [ -- cgit v1.2.3