diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-04 16:25:52 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2015-03-04 16:26:18 +0100 |
commit | 4b1b6d45f4fd3e7532fe10aec5af5ebbf0d813f7 (patch) | |
tree | 7f53dce240462e7fbd1684aea4b4f0d493ed360a | |
parent | c1228be6e52f5c33a87094f089c3f3c044af99e8 (diff) |
doc: Add new schemas and update test ones.
-rw-r--r-- | doc/schema-attachment.rst | 37 | ||||
-rw-r--r-- | doc/schema-measurement.rst | 15 | ||||
-rw-r--r-- | doc/schema/1.0/attachment.json | 18 | ||||
-rw-r--r-- | doc/schema/1.0/measurement.json | 20 | ||||
-rw-r--r-- | doc/schema/1.0/test_case_get.json | 26 | ||||
-rw-r--r-- | doc/schema/1.0/test_case_post.json | 24 | ||||
-rw-r--r-- | doc/schema/1.0/test_set_get.json | 4 |
7 files changed, 119 insertions, 25 deletions
diff --git a/doc/schema-attachment.rst b/doc/schema-attachment.rst new file mode 100644 index 0000000..39877c0 --- /dev/null +++ b/doc/schema-attachment.rst @@ -0,0 +1,37 @@ +.. _schema_attachment: + +attachment +---------- + +An `attachment` object is identified by two elements: + +1. Its server URI. +2. Its path on the server URI. + +The server URI is defined as the scheme and the authority in `URI notation <http://tools.ietf.org/html/rfc3986#section-3>`_; the attachment +path concides with the path in `URI notation <http://tools.ietf.org/html/rfc3986#section-3>`_: + +:: + + foo://example.net/I/am/a/file.txt + \_/ \_________/\______________/ + | | | + scheme authority path + +Attachments can be uploaded using the :ref:`upload API <collection_upload>`. + + +.. literalinclude:: schema/1.0/attachment.json + :language: json + +Notes +***** + +* ``server_uri``: If this field is not specified, it will default to ``storage.kernelci.org``. + +More Info +********* + +* :ref:`Upload API <collection_upload>` +* :ref:`API results <intro_schema_results>` +* `Uniform Resource Identifier (URI) <http://tools.ietf.org/html/rfc3986>`_ diff --git a/doc/schema-measurement.rst b/doc/schema-measurement.rst new file mode 100644 index 0000000..e50c8bf --- /dev/null +++ b/doc/schema-measurement.rst @@ -0,0 +1,15 @@ +.. _schema_measurement: + +measurement +----------- + +A measurement object is used to store a measure registered by a test case. + +.. literalinclude:: schema/1.0/measurement.json + :language: json + +More Info +********* + +* :ref:`Test case schema <schema_test_case>` +* :ref:`API results <intro_schema_results>` diff --git a/doc/schema/1.0/attachment.json b/doc/schema/1.0/attachment.json new file mode 100644 index 0000000..de9b9fc --- /dev/null +++ b/doc/schema/1.0/attachment.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://api.kernelci.org/json-schema/1.0/attachment.json", + "id": "http://api.kernelci.org/json-schema/1.0/attachment.json", + "title": "attachment", + "description": "An attachment/artifact JSON schema", + "type": "object", + "properties": { + "server_uri": { + "type": "string", + "description": "The URI of the server that is hosting this attachment" + }, + "path": { + "type": "string", + "description": "The path on the server that identifies this attachment" + } + }, + "required": ["path"] +} diff --git a/doc/schema/1.0/measurement.json b/doc/schema/1.0/measurement.json new file mode 100644 index 0000000..e9c2f38 --- /dev/null +++ b/doc/schema/1.0/measurement.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://api.kernelci.org/json-schema/1.0/measurement.json", + "id": "http://api.kernelci.org/json-schema/1.0/measurement.json", + "title": "measurement", + "description": "A measurement registered by a test case", + "type": "object", + "properties": { + "unit": { + "type": "string", + "description": "The unit of this measurement", + "enum": ["string", "epoch", "second", "minute", "watt", "volt"], + "default": "string" + }, + "measure": { + "type": "string", + "description": "The data measured during the test case execution; the value will be interpreted based on the $unit field" + } + }, + "required": ["measure"] +} diff --git a/doc/schema/1.0/test_case_get.json b/doc/schema/1.0/test_case_get.json index dadae21..bf76cb9 100644 --- a/doc/schema/1.0/test_case_get.json +++ b/doc/schema/1.0/test_case_get.json @@ -37,20 +37,10 @@ "type": "string", "description": "The test suite ID associated with this test case" }, - "unit": { - "type": "string", - "description": "The measurement unit associated with this test", - "enum": ["string", "epoch", "second", "minute", "watt", "volt"], - "default": "string" - }, "parameters": { "type": "object", "description": "Free form object to store key-value pairs describing the parameters used to run the test" }, - "measure": { - "type": "string", - "description": "The data measured during this test case execution; the value will be interpreted based on the unit field" - }, "status": { "type": "string", "description": "The status of the execution of this test case", @@ -62,8 +52,8 @@ "description": "The number of seconds it took to execute this test case", "default": -1 }, - "uri": { - "type": "uri", + "definition_uri": { + "type": "string", "description": "The URI where this test case definition is stored" }, "vcs_commit": { @@ -73,6 +63,18 @@ "metadata": { "type": "object", "description": "Free form object where accessory test case data is stored" + }, + "measurements": { + "type": "array", + "description": "Array of measurement objects registered by this test case", + "items": {"$ref": "http://api.kernelci.org/json-schema/1.0/measurement.json"}, + "additionalItems": true + }, + "attachments": { + "type": "array", + "description": "List of attachment objects produced by this test case", + "items": {"$ref": "http://api.kernelci.org/json-schema/1.0/attachment.json"}, + "additionalItems": true } } } diff --git a/doc/schema/1.0/test_case_post.json b/doc/schema/1.0/test_case_post.json index 8eb5a50..80207e3 100644 --- a/doc/schema/1.0/test_case_post.json +++ b/doc/schema/1.0/test_case_post.json @@ -22,20 +22,16 @@ "type": "string", "description": "The test suite ID associated with this test case" }, - "unit": { - "type": "string", - "description": "The measurement unit associated with this test", - "enum": ["string", "epoch", "second", "minute", "watt", "volt"], - "default": "string" + "measurements": { + "type": "array", + "description": "Array of measurement objects registered by this test case", + "items": {"$ref": "http://api.kernelci.org/json-schema/1.0/measurement.json"}, + "additionalItems": true }, "parameters": { "type": "object", "description": "Free form object to store key-value pairs describing the parameters used to run the test" }, - "measure": { - "type": "string", - "description": "The data measured during this test case execution; the value will be interpreted based on the unit field" - }, "status": { "type": "string", "description": "The status of the execution of this test case", @@ -47,14 +43,20 @@ "description": "The number of seconds it took to execute this test case", "default": -1 }, - "uri": { - "type": "uri", + "definition_uri": { + "type": "string", "description": "The URI where this test case definition is stored" }, "vcs_commit": { "type": "string", "description": "The VCS commit value if the $uri field is a VCS URI" }, + "attachments": { + "type": "array", + "description": "List of attachment objects produced by this test case", + "items": {"$ref": "http://api.kernelci.org/json-schema/1.0/attachment.json"}, + "additionalItems": true + }, "metadata": { "type": "object", "description": "Free form object where to store accessory test case data" diff --git a/doc/schema/1.0/test_set_get.json b/doc/schema/1.0/test_set_get.json index 298bd13..2cc1ffc 100644 --- a/doc/schema/1.0/test_set_get.json +++ b/doc/schema/1.0/test_set_get.json @@ -43,8 +43,8 @@ "items": {"$ref": "http://api.kernelci.org/json-schema/1.0/test_case_get.json"}, "additionalItems": true }, - "uri": { - "type": "uri", + "definition_uri": { + "type": "string", "description": "The URI where this test set definition is stored" }, "vcs_commit": { |