From b3281963275c66ba1c7de46fee42c5d97d05df42 Mon Sep 17 00:00:00 2001 From: Daniel Stahl Date: Thu, 3 Aug 2017 10:36:14 +0200 Subject: [PATCH 1/2] Stepped EiffelTestExecutionRecipeCollectionCreatedEvent to 2.0.0 As per issue #149. In 2.0.0 of the event, the syntax of data.batches.recipes.constraints changed to comply with protocol design guidelines. It is no longer an uncontrolled object, but a list of key-value pair, identical to data.customData. --- ...stExecutionRecipeCollectionCreatedEvent.md | 16 +- .../batches-1.0.0.json | 65 +++++ .../batches.json | 38 ++- .../batchesUri.json | 2 +- .../2.0.0.json | 263 ++++++++++++++++++ 5 files changed, 368 insertions(+), 16 deletions(-) create mode 100644 examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json create mode 100644 schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json diff --git a/eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md b/eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md index ba1efe4b..c4c8a4cd 100644 --- a/eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md +++ b/eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md @@ -98,9 +98,19 @@ __Required:__ No __Description:__ A location where a description of the test case can be retrieved. ##### data.batches.recipes.constraints -__Type:__ Object +__Type:__ Object[] __Required:__ No -__Description:__ Any constraints of the execution. The syntax of this object is not controlled, as the nature of such constraints are highly dependent on technology domain and test execution framework. That being said, there are three questions that typically need to be answered: what is the item under test, in what kind of environment is it to be tested, and what are the test parameters? +__Description:__ Any constraints of the execution. The nature of such constraints is highly dependent on technology domain and test execution framework. Consequently, there are no pre-defined or required constraints. Instead, this property is a list of key-value pairs on the same format as [data.customData](../customization/custom-data.md). That being said, there are three questions that typically need to be answered: what is the item under test, in what kind of environment is it to be tested, and what are the test parameters? + +###### data.batches.recipes.constraints.key +__Type:__ String +__Required:__ Yes +__Description:__ The key name of constraint. + +###### data.batches.recipes.constraints.value +__Type:__ Any +__Required:__ Yes +__Description:__ The value of the constraint. #### data.batches.dependencies __Type:__ Object[] @@ -120,8 +130,10 @@ __Description:__ The UUID of the dependent execution (__data.batches.recipes.id_ ## Version History | Version | Introduced in | Changes | | --------- | ------------------------------------------------------ | --------------------------------------- | +| 2.0.0 | Current version. | Changed syntax of data.batches.recipes.constraints from an uncontrolled object to a list of key-value pairs to comply with design guidelines. | | 1.0.0 | [edition-bordeaux](../../../tree/edition-bordeaux) | Initial version. | ## Examples * [Example using data.batches](../examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches.json) +* [Example using data.batches (1.0.0 syntax)](../examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json) * [Example using data.batchesUri](../examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batchesUri.json) \ No newline at end of file diff --git a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json new file mode 100644 index 00000000..6ab1b1ff --- /dev/null +++ b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json @@ -0,0 +1,65 @@ +{ + "meta": { + "type": "EiffelTestExecutionRecipeCollectionCreatedEvent", + "version": "1.0.0", + "time": 1234567890, + "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee0" + }, + "data": { + "selectionStrategy": { + "tracker": "My Test Selector", + "id": "TCSS-1234/5", + "uri": "http://tm.company.com/browse/TCSS-1234?version=5" + }, + "batches": [ + { + "name": "First batch", + "priority": 1, + "recipes": [ + { + "id": "aaaaaaaa-bbbb-5ccc-addd-eeeeeeeeeee0", + "testCase": { + "tracker": "My Test Management System", + "id": "TC-1234", + "uri": "http://tm.company.com/browse/TC-1234" + }, + "constraints": { + "load": 10000, + "environment": { + "os": "ubuntu-15.04", + "MY_PATH": "/home/lt-worf" + } + } + }, + { + "id": "aaaaaaaa-bbbb-5ccc-addd-eeeeeeeeeee1", + "testCase": { + "tracker": "My Test Management System", + "id": "TC-1234", + "uri": "http://tm.company.com/browse/TC-1234" + }, + "constraints": { + "load": 500, + "environment": { + "os": "ubuntu-16.04.1", + "MY_PATH": "/home/cpt-picard" + } + } + } + ], + "dependencies": [ + { + "dependent": "aaaaaaaa-bbbb-5ccc-addd-eeeeeeeeeee0", + "dependency": "aaaaaaaa-bbbb-5ccc-addd-eeeeeeeeeee1" + } + ] + } + ] + }, + "links": [ + { + "type": "CONTEXT", + "target": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee1" + } + ] +} diff --git a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches.json b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches.json index 858e3ed7..376e063b 100644 --- a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches.json +++ b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches.json @@ -1,7 +1,7 @@ { "meta": { "type": "EiffelTestExecutionRecipeCollectionCreatedEvent", - "version": "1.0.0", + "version": "2.0.0", "time": 1234567890, "id": "aaaaaaaa-bbbb-5ccc-8ddd-eeeeeeeeeee0" }, @@ -23,13 +23,19 @@ "id": "TC-1234", "uri": "http://tm.company.com/browse/TC-1234" }, - "constraints": { - "load": 10000, - "environment": { - "os": "ubuntu-15.04", - "MY_PATH": "/home/lt-worf" + "constraints": [ + { + "key": "load", + "value": 10000 + }, + { + "key": "environment", + "value": { + "os": "ubuntu-15.04", + "MY_PATH": "/home/lt-worf" + } } - } + ] }, { "id": "aaaaaaaa-bbbb-5ccc-addd-eeeeeeeeeee1", @@ -38,13 +44,19 @@ "id": "TC-1234", "uri": "http://tm.company.com/browse/TC-1234" }, - "constraints": { - "load": 500, - "environment": { - "os": "ubuntu-16.04.1", - "MY_PATH": "/home/cpt-picard" + "constraints": [ + { + "key": "load", + "value": 500 + }, + { + "key": "environment", + "value": { + "os": "ubuntu-16.04.1", + "MY_PATH": "/home/cpt-picard" + } } - } + ] } ], "dependencies": [ diff --git a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batchesUri.json b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batchesUri.json index 3262b75f..3ed142a4 100644 --- a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batchesUri.json +++ b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batchesUri.json @@ -1,7 +1,7 @@ { "meta": { "type": "EiffelTestExecutionRecipeCollectionCreatedEvent", - "version": "1.0.0", + "version": "2.0.0", "time": 1234567890, "source": { "domainId": "example.domain" diff --git a/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json b/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json new file mode 100644 index 00000000..1bac7c70 --- /dev/null +++ b/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json @@ -0,0 +1,263 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ "EiffelTestExecutionRecipeCollectionCreatedEvent" ] + }, + "version": { + "type": "string", + "enum": [ "2.0.0" ], + "default": "2.0.0" + }, + "time": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "source": { + "type": "object", + "properties": { + "domainId": { + "type": "string" + }, + "host": { + "type": "string" + }, + "name": { + "type": "string" + }, + "serializer": { + "type": "object", + "properties": { + "groupId": { + "type": "string" + }, + "artifactId": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "required": [ + "groupId", + "artifactId", + "version" + ], + "additionalProperties": false + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "security": { + "type": "object", + "properties": { + "sdm": { + "type": "object", + "properties": { + "authorIdentity": { + "type": "string" + }, + "encryptedDigest": { + "type": "string" + } + }, + "required": [ + "authorIdentity", + "encryptedDigest" + ], + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "required": [ + "id", + "type", + "version", + "time" + ], + "additionalProperties": false + }, + "data": { + "type": "object", + "properties": { + "selectionStrategy": { + "type": "object", + "properties": { + "tracker": { + "type": "string" + }, + "id": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "batchesUri": { + "type": "string" + }, + "batches": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "recipes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "testCase": { + "type": "object", + "properties": { + "tracker": { + "type": "string" + }, + "id": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "required": [ + "id" + ], + "additionalProperties": false + }, + "constraints": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "id", + "testCase" + ], + "additionalProperties": false + } + }, + "dependencies": { + "type": "array", + "items": { + "type": "object", + "properties": { + "dependent": { + "type": "string" + }, + "dependency": { + "type": "string" + } + }, + "required": [ + "dependent", + "dependency" + ], + "additionalProperties": false + } + } + }, + "required": [ + "priority", + "recipes" + ], + "additionalProperties": false + } + }, + "customData": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "value": { + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "selectionStrategy" + ], + "additionalProperties": false + }, + "links": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "target": { + "type": "string" + } + }, + "required": [ + "type", + "target" + ], + "additionalProperties": false + } + } + }, + "required": [ + "meta", + "data", + "links" + ], + "additionalProperties": false +} From 078dade7d3cba0d52f60ca07c927b58ab98e00b5 Mon Sep 17 00:00:00 2001 From: Daniel Stahl Date: Thu, 9 Nov 2017 12:39:50 +0100 Subject: [PATCH 2/2] Updated schema for EiffelTestExecutionRecipeCollectionCreatedEvent 2.0.0. Fixed incorrect UUID in EiffelTestExecutionRecipeCollectionCreatedEvent examples. --- .../batches-1.0.0.json | 4 ++-- .../2.0.0.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json index 6ab1b1ff..858e3ed7 100644 --- a/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json +++ b/examples/events/EiffelTestExecutionRecipeCollectionCreatedEvent/batches-1.0.0.json @@ -3,7 +3,7 @@ "type": "EiffelTestExecutionRecipeCollectionCreatedEvent", "version": "1.0.0", "time": 1234567890, - "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee0" + "id": "aaaaaaaa-bbbb-5ccc-8ddd-eeeeeeeeeee0" }, "data": { "selectionStrategy": { @@ -59,7 +59,7 @@ "links": [ { "type": "CONTEXT", - "target": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeee1" + "target": "aaaaaaaa-bbbb-5ccc-8ddd-eeeeeeeeeee1" } ] } diff --git a/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json b/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json index 1bac7c70..2d4667e3 100644 --- a/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json +++ b/schemas/EiffelTestExecutionRecipeCollectionCreatedEvent/2.0.0.json @@ -6,7 +6,8 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }, "type": { "type": "string",