JSON schema and examples for Fuego's run.json format
Hi,
I have a preliminar schema for Fuego's run.json format and a couple of examples.
# run.json represents the result of running a test and the associated metadata
The schema is heavily based on Kernel CI's schemas. The main differences are:
- I have removed items that we don't need at the moment (kvm_guest...)
- I have defined several metadata items specific for fuego
- I have renamed some keys (e.g.: duration_ms instead of time)
- I have produced a single embedded schema instead of using references to other files
- I allow nesting test sets inside test sets
- I have added the concept of reference values
You can validate the provided examples with the schema at:
http://www.jsonschemavalidator.net/
This is still a draft so any feedback or suggestion is very welcomed.
Thanks,
Daniel
P.S.: I'm also working on the "unified output format" proposal but this will probably take me some time. The unified output format will be just a specification to make test logs easy to parse, and it's something different from run.json files which are a method to store results and metadata before submitting it to a server or converting it to a different format.
P.S: I send the files attached, but for the record and for inline comments I paste the file contents inline.
*** fuego-schema.json ***
{
"$schema":"http://json-schema.org/schema#",
"id":"http://http://www.fuegotest.org/download/fuego_schema_v1.0.json",
"title":"test_suite",
"description":"A test suite JSON object corresponding to a single Fuego job run or execution",
"definitions":{
"status":{
"type":"string",
"description":"The status of the execution of this test case",
"enum":[
"PASS",
"FAIL",
"SKIP",
"ERROR"
],
"default":"PASS"
},
"measurement":{
"title":"measurement",
"description":"A measurement registered by a test case",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"The name given to this measurement"
},
"unit":{
"type":"string",
"description":"The unit of this measurement"
},
"measure":{
"type":[
"string",
"number",
"integer"
],
"description":"The data measured during the test case execution; the value will be interpreted based on the $unit field"
},
"status":{
"$ref":"#/definitions/status"
},
"reference":{
"type":"object",
"description":"Reference measure that is compared to a measure to decide the status",
"properties":{
"threshold":{
"type":[
"string",
"number",
"integer"
],
"description":"A threshold value",
"default":"integer"
},
"comparison":{
"type":"string",
"description":"Type of comparison",
"enum":[
"eq",
"ne",
"gt",
"ge",
"lt",
"le"
],
"default":"gt"
}
}
}
},
"required":[
"measure"
]
},
"attachment":{
"title":"attachment",
"description":"the location of a file",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"The name given to the attachment"
},
"server_uri":{
"type":"string",
"description":"A URI that points to this attachment"
},
"path":{
"type":"string",
"description":"A path in the test results package that identifies this attachment"
}
},
"required":[
"path"
]
},
"test_case":{
"type":"object",
"description":"A test case is the smallest test program",
"properties":{
"tguid":{
"type":"string",
"description":"globally unique identifier for the test case"
},
"name":{
"type":"string",
"description":"The name given to this test case"
},
"status":{
"$ref":"#/definitions/status"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute this test case",
"default":-1
},
"measurements":{
"type":"array",
"description":"Array of measurement objects registered by this test case",
"items":{
"$ref":"#/definitions/measurement"
}
},
"attachments":{
"type":"array",
"description":"List of attachment objects produced by this test case",
"items":{
"$ref":"#/definitions/attachment"
},
"additionalItems":true
}
},
"required":[
"tguid",
"status"
]
},
"test_set":{
"title":"test_set",
"description":"A test set is a group of test cases",
"type":"object",
"properties":{
"tguid":{
"type":"string",
"description":"globally unique identifier for the test case"
},
"name":{
"type":"string",
"description":"The name given to this test set"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute the test set"
},
"test_case":{
"type":"array",
"description":"The list of test case objects executed by this test set",
"items":{
"$ref":"#/definitions/test_case"
}
},
"test_set":{
"type":"array",
"description":"Nested test set",
"items":{
"$ref":"#/definitions/test_set"
}
}
},
"required":[
"tguid"
]
}
},
"type":"object",
"properties":{
"version":{
"type":"string",
"description":"The version number of this JSON schema",
"enum":[
"1.0"
]
},
"name":{
"type":"string",
"description":"The name given to this test suite"
},
"tguid":{
"type":"string",
"description":"Fuego's test globally unique identifier"
},
"status":{
"$ref":"#/definitions/status"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute the entire test suite",
"default":-1
},
"test_set":{
"type":"array",
"description":"The list of test set objects, executed by this test suite",
"items":{
"$ref":"#/definitions/test_set"
}
},
"test_case":{
"type":"array",
"description":"List of test case objects when they do not belong to a test set",
"items":{
"$ref":"#/definitions/test_case"
}
},
"metadata":{
"type":"object",
"description":"Object to store Fuego parameters and other accessory data",
"properties":{
"fuego_version":{
"type":"string",
"description":"The version of fuego (commit id, tag, ..)"
},
"fuego_core_version":{
"type":"string",
"description":"The version of fuego core (commit id, tag, ..)"
},
"testsuite_version":{
"type":"string",
"description":"string that identifies the testsuite source code (commit id, tarball version..)"
},
"host_name":{
"type":"string",
"description":"The name of the host executing this test suite"
},
"board_type":{
"type":"string",
"description":"The name of the board"
},
"board_instance":{
"type":"string",
"description":"The instance identifier of the board (for LAVA)"
},
"compiled_on":{
"type":"string",
"description":"The machine where the test was compiled"
},
"job_name":{
"type":"string",
"description":"The name of the job"
},
"kernel_version":{
"type":"string",
"description":"The version of the kernel running on the board"
},
"start_time":{
"type":"string",
"description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when the test suite execution was started",
"format":"date-time"
},
"test_plan":{
"type":"string",
"description":"The test plan used"
},
"test_spec":{
"type":"string",
"description":"The test spec used"
},
"build_number":{
"type":"number",
"description":"The build number"
},
"keep_log":{
"type":"boolean",
"description":"The keep_log flag"
},
"reboot":{
"type":"boolean",
"description":"The reboot flag"
},
"rebuild":{
"type":"boolean",
"description":"The rebuild flag"
},
"target_precleanup":{
"type":"boolean",
"description":"The target_precleanup flag"
},
"target_postcleanup":{
"type":"boolean",
"description":"The target_postcleanup flag"
},
"workspace":{
"type":"string",
"description":"The workspace path"
},
"attachments":{
"type":"array",
"description":"List of attachment objects produced by this test suite",
"items":{
"$ref":"#/definitions/attachment"
},
"additionalItems":true
}
},
"required":[
"fuego_version",
"host_name",
"board_type",
"job_name",
"test_spec"
]
}
},
"required":[
"version",
"tguid",
"status",
"metadata"
]
}*** fuego-run-example-dhrystone.json ***
{
"version":"1.0",
"tguid":"34234acdddac9234110000accvbb",
"name":"Benchmark.Dhrystone",
"status":"PASS",
"duration_ms":13425,
"test_case":[
{
"tguid":"ab2344cfa34546564s234acfddddaaa2342",
"name":"Dhrystone",
"status":"PASS",
"duration_ms":13400,
"measurements":[
{
"measure":1111111.1,
"unit":"Dhrystones per Second",
"status":"PASS",
"reference":{
"threshold":"1",
"comparison":"gt"
}
}
]
}
],
"metadata":{
"fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"docker.default.Benchmark.Dhrystone",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-26T09:03:04Z",
"toolchain":"qemu-armv7hf",
"build_number":4,
"keep_log":true,
"reboot":false,
"rebuild":true,
"target_precleanup":true,
"target_postcleanup":true,
"workspace":"/fuego-rw/buildzone",
"attachments":[
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"syslog.before",
"path":"syslog.before.txt"
},
{
"name":"syslog.after",
"path":"syslog.after.txt"
},
{
"name":"testlog",
"path":"testlog.txt"
},
{
"name":"consolelog",
"path":"consolelog.txt"
},
{
"name":"test_spec",
"path":"spec.json"
}
]
}
}*** fuego-run-example-bonnie.json ***
{
"version":"1.0",
"tguid":"334453ascdddac92341100ssd00acc3vbb",
"name":"Benchmark.bonnie",
"status":"PASS",
"duration_ms":118352,
"test_set":[
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Random_Create",
"status":"PASS",
"test_case":[
{
"tguid":"123a34546564s234acfddddaaa2342",
"name":"Create",
"status":"PASS",
"measurements":[
{
"measure":6050
}
]
},
{
"tguid":"234567234cfa34546564s234acfddddaaa2342",
"name":"Delete",
"status":"PASS",
"measurements":[
{
"measure":12695
}
]
}
]
},
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Sequential_Create",
"status":"PASS",
"test_case":[
{
"tguid":"123423a34546564s234acfddddaaa2342",
"name":"Create",
"status":"PASS",
"measurements":[
{
"measure":9563
}
]
},
{
"tguid":"5612342357234cfa34546564s234acfddddaaa2342",
"name":"Delete",
"status":"PASS",
"measurements":[
{
"measure":13379
}
]
}
]
},
{
"tguid":"235434546564s234acfddddaaa2342",
"name":"Sequential_Input",
"status":"PASS",
"test_case":[
{
"tguid":"123213454a34546564s234acfddddaaa2342",
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"measure":6581
}
]
}
]
},
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Sequential_Output",
"status":"PASS",
"test_case":[
{
"tguid":"123a23453434546564s234acfddddaaa2342",
"name":"Block",
"status":"PASS",
"measurements":[
{
"measure":0
}
]
},
{
"tguid":"245345567234cfa34546564s234acfddddaaa2342",
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"measure":6538
}
]
},
{
"tguid":"656345567234cfa34546564s234acfddddaaa2342",
"name":"Rewrite",
"status":"PASS",
"measurements":[
{
"measure":0
}
]
}
]
}
],
"metadata":{
"fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"testsuite_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"docker.default.Benchmark.bonnie",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-29T06:43:43Z",
"toolchain":"qemu-armv7hf",
"build_number":1,
"keep_log":true,
"reboot":false,
"rebuild":true,
"target_precleanup":true,
"target_postcleanup":true,
"workspace":"/fuego-rw/buildzone",
"attachments":[
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"syslog.before",
"path":"syslog.before.txt"
},
{
"name":"syslog.after",
"path":"syslog.after.txt"
},
{
"name":"testlog",
"path":"testlog.txt"
},
{
"name":"consolelog",
"path":"consolelog.txt"
},
{
"name":"test_spec",
"path":"spec.json"
}
]
}
}Quoted 27 lines
-----Original Message-----
From: Daniel Sangorrin on Thursday, June 29, 2017 1:12 AM
I have a preliminar schema for Fuego's run.json format and a couple of examples.# run.json represents the result of running a test and the associated metadataThe schema is heavily based on Kernel CI's schemas. The main differences are:
- I have removed items that we don't need at the moment (kvm_guest...)
- I have defined several metadata items specific for fuego
- I have renamed some keys (e.g.:duration_msinstead of time)
- I have produced a single embedded schema instead of using references to other files
- I allow nesting test sets inside test sets
- I have added the concept of reference valuesYou can validate the provided examples with the schema at:
http://www.jsonschemavalidator.net/This is still a draft so any feedback or suggestion is very welcomed.
Thanks,
Daniel
Quoted 8 lines
P.S.: I'm also working on the "unified output format" proposal but this will probably take me
some time. The unified output format will be just a specification to make test logs
easy to parse, and it's something different from run.json files which are a method to
store results and metadata before submitting it to a server or converting it to a different format.
OK - I have been referring to the consistent formatting of results from Fuego as the "unified output format". That is, what you're working on here. However, I can see how the name could be applied to the output from tests. Maybe we should choose different names to distinguish the 2 different items:
- fuego canonical results format (what I was calling "unified output format")
- test recommended output format
Many tests will be not under our control, so we won't be able to dictate this. But, as with kselftest output for the kernel, we can make recommendations and work towards consistent test log output over time, to make it is easier for Fuego (and other test systems) to parse.
Quoted 10 lines
P.S: I send the files attached, but for the record and for inline comments I paste the file contents inline.*** fuego-schema.json ***
{ "$schema":"http://json-schema.org/schema#","id":"http://http://www.fuegotest.org/download/fuego_schema_v1.0.json ",
This seems to have an extra 'http://'
Quoted 187 lines
"title":"test_suite",
"description":"A test suite JSON object corresponding to a single Fuego job
run or execution","definitions":{ "status":{ "type":"string", "description":"The status of the execution of this test case", "enum":[ "PASS", "FAIL", "SKIP", "ERROR" ], "default":"PASS" }, "measurement":{ "title":"measurement", "description":"A measurement registered by a test case", "type":"object", "properties":{ "name":{ "type":"string", "description":"The name given to this measurement" }, "unit":{ "type":"string", "description":"The unit of this measurement" }, "measure":{ "type":[ "string", "number", "integer" ], "description":"The data measured during the test case execution; the value will be interpreted based on the $unit field" }, "status":{ "$ref":"#/definitions/status" }, "reference":{ "type":"object", "description":"Reference measure that is compared to a measure to decide the status", "properties":{ "threshold":{ "type":[ "string", "number", "integer" ], "description":"A threshold value", "default":"integer" }, "comparison":{ "type":"string", "description":"Type of comparison", "enum":[ "eq", "ne", "gt", "ge", "lt", "le" ], "default":"gt" } } } }, "required":[ "measure" ] }, "attachment":{ "title":"attachment", "description":"the location of a file", "type":"object", "properties":{ "name":{ "type":"string", "description":"The name given to the attachment" }, "server_uri":{ "type":"string", "description":"A URI that points to this attachment" }, "path":{ "type":"string", "description":"A path in the test results package that identifies this attachment" } }, "required":[ "path" ] }, "test_case":{ "type":"object", "description":"A test case is the smallest test program", "properties":{ "tguid":{ "type":"string", "description":"globally unique identifier for the test case" }, "name":{ "type":"string", "description":"The name given to this test case" }, "status":{ "$ref":"#/definitions/status" }, "duration_ms":{ "type":"number", "description":"The number of ms it took to execute this test case", "default":-1 }, "measurements":{ "type":"array", "description":"Array of measurement objects registered by this test case", "items":{ "$ref":"#/definitions/measurement" } }, "attachments":{ "type":"array", "description":"List of attachment objects produced by this test case", "items":{ "$ref":"#/definitions/attachment" }, "additionalItems":true } }, "required":[ "tguid", "status" ] }, "test_set":{ "title":"test_set", "description":"A test set is a group of test cases", "type":"object", "properties":{ "tguid":{ "type":"string", "description":"globally unique identifier for the test case" }, "name":{ "type":"string", "description":"The name given to this test set" }, "duration_ms":{ "type":"number", "description":"The number of ms it took to execute the test set" }, "test_case":{ "type":"array", "description":"The list of test case objects executed by this test set", "items":{ "$ref":"#/definitions/test_case" } }, "test_set":{ "type":"array", "description":"Nested test set", "items":{ "$ref":"#/definitions/test_set" } } }, "required":[ "tguid" ] } }, "type":"object", "properties":{ "version":{ "type":"string", "description":"The version number of this JSON schema", "enum":[ "1.0" ] },
Quoted 8 lines
"name":{
"type":"string",
"description":"The name given to this test suite"
},
"tguid":{
"type":"string",
"description":"Fuego's test globally unique identifier"
},Hey - thanks! But this would only be a partial tguid. Each individual measurement should be able to be identified by a fully-qualified tguid (which maybe consists of <this-tguid>.<test_set>.<test_case>.<measurement>
Quoted 69 lines
"status":{
"$ref":"#/definitions/status"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute the entire test
suite",
"default":-1
},
"test_set":{
"type":"array",
"description":"The list of test set objects, executed by this test suite",
"items":{
"$ref":"#/definitions/test_set"
}
},
"test_case":{
"type":"array",
"description":"List of test case objects when they do not belong to a
test set",
"items":{
"$ref":"#/definitions/test_case"
}
},
"metadata":{
"type":"object",
"description":"Object to store Fuego parameters and other accessory
data",
"properties":{
"fuego_version":{
"type":"string",
"description":"The version of fuego (commit id, tag, ..)"
},
"fuego_core_version":{
"type":"string",
"description":"The version of fuego core (commit id, tag, ..)"
},
"testsuite_version":{
"type":"string",
"description":"string that identifies the testsuite source code
(commit id, tarball version..)"
},
"host_name":{
"type":"string",
"description":"The name of the host executing this test suite"
},
"board_type":{
"type":"string",
"description":"The name of the board"
},
"board_instance":{
"type":"string",
"description":"The instance identifier of the board (for LAVA)"
},
"compiled_on":{
"type":"string",
"description":"The machine where the test was compiled"
},
"job_name":{
"type":"string",
"description":"The name of the job"
},
"kernel_version":{
"type":"string",
"description":"The version of the kernel running on the board"
},
"start_time":{
"type":"string",
"description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when theQuoted 1 line
test suite execution was started",
This is a change, but it appears to be iso 8601-compliant. I'd rather not be required to express the start time in UTC. I think we should allow TimeZone offsets here (maybe you do). I like to see times in a locally-relevant time format. This is one of my chief gripes about Jenkins.
Quoted 66 lines
"format":"date-time" }, "test_plan":{ "type":"string", "description":"The test plan used" }, "test_spec":{ "type":"string", "description":"The test spec used" }, "build_number":{ "type":"number", "description":"The build number" }, "keep_log":{ "type":"boolean", "description":"The keep_log flag" }, "reboot":{ "type":"boolean", "description":"The reboot flag" }, "rebuild":{ "type":"boolean", "description":"The rebuild flag" }, "target_precleanup":{ "type":"boolean", "description":"The target_precleanup flag" }, "target_postcleanup":{ "type":"boolean", "description":"The target_postcleanup flag" }, "workspace":{ "type":"string", "description":"The workspace path" }, "attachments":{ "type":"array", "description":"List of attachment objects produced by this test suite", "items":{ "$ref":"#/definitions/attachment" }, "additionalItems":true } }, "required":[ "fuego_version", "host_name", "board_type", "job_name", "test_spec" ] } }, "required":[ "version", "tguid", "status", "metadata" ] }*** fuego-run-example-dhrystone.json ***
Quoted 9 lines
{
"version":"1.0",
"tguid":"34234acdddac9234110000accvbb",
"name":"Benchmark.Dhrystone",
"status":"PASS",
"duration_ms":13425,
"test_case":[
{
"tguid":"ab2344cfa34546564s234acfddddaaa2342",I want the tguid to be human readable, and invariant over runs. In this case, I think the tguid for the single-measurement item should be "Dhrystone.Dhrystone"
Quoted 10 lines
"name":"Dhrystone",
"status":"PASS",
"duration_ms":13400,
"measurements":[
{
"measure":1111111.1,
"unit":"Dhrystones per Second",
"status":"PASS",
"reference":{
"threshold":"1",Quoted 8 lines
"comparison":"gt"
}
}
]
}
],
"metadata":{
"fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",Can we do these with 'git describe' strings instead?
ex: "fuego_version":"v1.1-24-g5ad677b"
Quoted 2 lines
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",I assume this duplication is a typo.
Quoted 8 lines
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"docker.default.Benchmark.Dhrystone",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-26T09:03:04Z",Is this actually in UTC, rather than localtime? Where are you getting this from? date? python time.time?
Quoted 42 lines
"toolchain":"qemu-armv7hf", "build_number":4, "keep_log":true, "reboot":false, "rebuild":true, "target_precleanup":true, "target_postcleanup":true, "workspace":"/fuego-rw/buildzone", "attachments":[ { "name":"devlog", "path":"devlog.txt" }, { "name":"devlog", "path":"devlog.txt" }, { "name":"syslog.before", "path":"syslog.before.txt" }, { "name":"syslog.after", "path":"syslog.after.txt" }, { "name":"testlog", "path":"testlog.txt" }, { "name":"consolelog", "path":"consolelog.txt" }, { "name":"test_spec", "path":"spec.json" } ] } }*** fuego-run-example-bonnie.json ***
Quoted 15 lines
{
"version":"1.0",
"tguid":"334453ascdddac92341100ssd00acc3vbb",
"name":"Benchmark.bonnie",
"status":"PASS",
"duration_ms":118352,
"test_set":[
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Random_Create",
"status":"PASS",
"test_case":[
{
"tguid":"123a34546564s234acfddddaaa2342",
"name":"Create",tguid would be: "bonnie.Random_Create.Create"
I think we can synthesize the tguid from the name fields. If it's unambiguous how to generate an invariant name for a test case/measure, then there's no need to have a separate field for the tguid.
The idea with TGUIDs is that we can compare them between test systems. As an example, I'd like to be able to compare a 0-day Dhrystone.Dhrystone value for the latest kernel with a Fuego Dhrystone.Dhrystone value for the LTSI kernel.
Quoted 158 lines
"status":"PASS",
"measurements":[
{
"measure":6050
}
]
},
{
"tguid":"234567234cfa34546564s234acfddddaaa2342",
"name":"Delete",
"status":"PASS",
"measurements":[
{
"measure":12695
}
]
}
]
},
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Sequential_Create",
"status":"PASS",
"test_case":[
{
"tguid":"123423a34546564s234acfddddaaa2342",
"name":"Create",
"status":"PASS",
"measurements":[
{
"measure":9563
}
]
},
{
"tguid":"5612342357234cfa34546564s234acfddddaaa2342",
"name":"Delete",
"status":"PASS",
"measurements":[
{
"measure":13379
}
]
}
]
},
{
"tguid":"235434546564s234acfddddaaa2342",
"name":"Sequential_Input",
"status":"PASS",
"test_case":[
{
"tguid":"123213454a34546564s234acfddddaaa2342",
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"measure":6581
}
]
}
]
},
{
"tguid":"234534546564s234acfddddaaa2342",
"name":"Sequential_Output",
"status":"PASS",
"test_case":[
{
"tguid":"123a23453434546564s234acfddddaaa2342",
"name":"Block",
"status":"PASS",
"measurements":[
{
"measure":0
}
]
},
{
"tguid":"245345567234cfa34546564s234acfddddaaa2342",
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"measure":6538
}
]
},
{
"tguid":"656345567234cfa34546564s234acfddddaaa2342",
"name":"Rewrite",
"status":"PASS",
"measurements":[
{
"measure":0
}
]
}
]
}
],
"metadata":{
"fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"testsuite_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"docker.default.Benchmark.bonnie",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-29T06:43:43Z",
"toolchain":"qemu-armv7hf",
"build_number":1,
"keep_log":true,
"reboot":false,
"rebuild":true,
"target_precleanup":true,
"target_postcleanup":true,
"workspace":"/fuego-rw/buildzone",
"attachments":[
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"syslog.before",
"path":"syslog.before.txt"
},
{
"name":"syslog.after",
"path":"syslog.after.txt"
},
{
"name":"testlog",
"path":"testlog.txt"
},
{
"name":"consolelog",
"path":"consolelog.txt"
},
{
"name":"test_spec",
"path":"spec.json"
}
]
}
}Hi Tim,
Thanks for your review. Before I modify the schema I want to confirm a few items.
1) tguids
Quoted 8 lines
Quoted 4 lines
"tguid":{ "type":"string", "description":"Fuego's test globally unique identifier" },Hey - thanks! But this would only be a partial tguid. Each individual measurement should be able to be identified by a fully-qualified tguid (which maybe consists of <this-tguid>.<test_set>.<test_case>.<measurement>
...
Quoted 7 lines
Quoted 3 lines
"test_case":[ { "tguid":"ab2344cfa34546564s234acfddddaaa2342",I want the tguid to be human readable, and invariant over runs. In this case, I think the tguid for the single-measurement item should be "Dhrystone.Dhrystone"
..
Quoted 5 lines
Quoted 2 lines
"tguid":"123a34546564s234acfddddaaa2342", "name":"Create",tguid would be: "bonnie.Random_Create.Create"
Quoted 8 lines
I think we can synthesize the tguid from the name fields. If it's unambiguous how to generate an invariant name for a test case/measure, then there's no need to have a separate field for the tguid.
The idea with TGUIDs is that we can compare them between test systems. As an example, I'd like to be able to compare a 0-day Dhrystone.Dhrystone value for the latest kernel with a Fuego Dhrystone.Dhrystone value for the LTSI kernel.
OK - based on your comments, I think that I should remove all "tguid" fields from the schema and instead enforce (with the 'required' token) that all test suites/sets/cases/measures have a name. This way we can just infer the TGUIDs from the names.
What do you think?
Milo (if you read this): do you see any specific reason for using a hash in Fuego as in Kernel CI?
2) timestamp format
Quoted 12 lines
Quoted 5 lines
"start_time":{ "type":"string", "description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when the test suite execution was started", "format":"date-time"This is a change, but it appears to be iso 8601-compliant. I'd rather not be required to express the start time in UTC. I think we should allow TimeZone offsets here (maybe you do). I like to see times in a locally-relevant time format. This is one of my chief gripes about Jenkins.
Quoted 3 lines
Quoted 1 line
"start_time":"2017-06-26T09:03:04Z",Is this actually in UTC, rather than localtime? Where are you getting this from? date? python time.time?
The "date-time" format is a built-in format in the JSON schema specification. It is explained at [1] and can be used both in UTC and in local time.
UTC example from [1]: 1985-04-12T23:20:50.52Z
This represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.
Local time example from [1]: 1996-12-19T16:39:57-08:00
This represents 39 minutes and 57 seconds after the 16th hour of December 19th, 1996 with an offset of -08:00 from UTC (Pacific Standard Time). Note that this is equivalent to 1996-12-20T00:39:57Z in UTC.
In python you can get local time in two ways:
With tzlocal (pip install tzlocal)
import tzlocal, datetime
d = datetime.datetime.now(tz=tzlocal.get_localzone()) print d.isoformat('T')
2017-06-30T09:13:27.507494+09:00
With dateutil
import dateutil.tz, datetime
d = datetime.datetime.now(dateutil.tz.tzlocal()) print d.isoformat('T')
2017-06-30T09:13:27.507494+09:00
[1] https://tools.ietf.org/html/rfc3339
3) Others
Quoted 4 lines
Quoted 2 lines
"metadata":{ "fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",Can we do these with 'git describe' strings instead?
ex: "fuego_version":"v1.1-24-g5ad677b"
Sure, JSON schema allows expressing the format with regular expressions. Should I add one?
Quoted 5 lines
Quoted 2 lines
"fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b", "fuego_core_version":"b98ae34f3c2199c46cc229ca209fc39faded938b",I assume this duplication is a typo.
Yes, it meant to be testsuite_version.
Thanks,
Daniel
Quoted 51 lines
-----Original Message-----
From: Daniel Sangorrin [mailto:[email protected]]
Sent: Thursday, June 29, 2017 5:24 PM
To: Bird, Timothy <[email protected]>; 'Milo Casagrande' <[email protected]>; [email protected]
Subject: RE: [Fuego] JSON schema and examples for Fuego's run.json formatHi Tim,
Thanks for your review. Before I modify the schema I want to confirm a few items.
1) tguids
Quoted 6 lines
Quoted 4 lines
"tguid":{ "type":"string", "description":"Fuego's test globally unique identifier" },Hey - thanks! But this would only be a partial tguid. Each individual
measurement
Quoted 1 line
should be able to be identified by a fully-qualified tguid (which maybe
consists
Quoted 1 line
of <this-tguid>.<test_set>.<test_case>.<measurement>
...
Quoted 7 lines
Quoted 3 lines
"test_case":[ { "tguid":"ab2344cfa34546564s234acfddddaaa2342",I want the tguid to be human readable, and invariant over runs. In this case, I think the tguid for the single-measurement item should be "Dhrystone.Dhrystone"
..
Quoted 6 lines
Quoted 2 lines
"tguid":"123a34546564s234acfddddaaa2342", "name":"Create",tguid would be: "bonnie.Random_Create.Create"
I think we can synthesize the tguid from the name fields. If it's
unambiguous
Quoted 5 lines
how to generate an invariant name for a test case/measure, then there's no need to have a separate field for the tguid.
The idea with TGUIDs is that we can compare them between test systems. As an example, I'd like to be able to compare a 0-day Dhrystone.Dhrystone
value
Quoted 2 lines
for the latest kernel with a Fuego Dhrystone.Dhrystone value for the LTSI kernel.
Quoted 6 lines
OK - based on your comments, I think that I should remove all "tguid" fields from the schema and
instead enforce (with the 'required' token) that all test suites/sets/cases/measures have
a name. This way we can just infer the TGUIDs from the names. What do you think?
Agreed. I'm a bit worried about names not being globally invariant, based on supporting multiple "paths" to the testcase, depending on the structure of the tests and optional nesting of test_sets.
e.g. Could LTP.syscall.kill10 end up being the same as LTP.RT-tests.functions.kill10? or could some super-test run LTP tests, resulting in a different string for the same test, like so: OpenTest.LTP.syscall.kill10?
I'd say that for now, just make 'name' required, and we'll see what issues crop up and we start using it.
Quoted 3 lines
Milo (if you read this): do you see any specific reason for using a hash in Fuego as in Kernel CI?
What is the hash used for in KernelCI? It almost looks like a per-run value, instead of a per-test value.
Quoted 41 lines
2) timestamp format
Quoted 12 lines
Quoted 5 lines
"start_time":{ "type":"string", "description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when the test suite execution was started", "format":"date-time"This is a change, but it appears to be iso 8601-compliant. I'd rather not be required to express the start time in UTC. I think we should allow TimeZone offsets here (maybe you do). I like to see times in a locally-relevant time format. This is one of my chief gripes about Jenkins.
Quoted 3 lines
Quoted 1 line
"start_time":"2017-06-26T09:03:04Z",Is this actually in UTC, rather than localtime? Where are you getting this from? date? python time.time?
The "date-time" format is a built-in format in the JSON schema specification. It is
explained at [1] and can be used both in UTC and in local time.UTC example from [1]: 1985-04-12T23:20:50.52Z
This represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.Local time example from [1]: 1996-12-19T16:39:57-08:00
This represents 39 minutes and 57 seconds after the 16th hour of December 19th, 1996 with an offset of -08:00 from UTC (Pacific Standard Time). Note that this is equivalent to 1996-12-20T00:39:57Z in UTC.In python you can get local time in two ways:
With tzlocal (pip install tzlocal)
import tzlocal, datetime
d = datetime.datetime.now(tz=tzlocal.get_localzone()) printd.isoformat('T')
2017-06-30T09:13:27.507494+09:00
Quoted 7 lines
With dateutil
import dateutil.tz, datetime
d = datetime.datetime.now(dateutil.tz.tzlocal()) printd.isoformat('T')
2017-06-30T09:13:27.507494+09:00
The RFC3339 spec only allows 1 digit of fractional seconds, according to my reading of the spec. I believe ISO8601 allows more fractional seconds digits, but I'd like to stick to a strict subset of ISO8601 for the reasons mentioned in RFC3339. I dug into this today (in probably too much gory detail)
and Python and C support for RFC3339 is kind of messed up.
See my notes on this at:
http://bird.org/fuego/Issue_0047
I'm working on a patch that uses timestamps in the following format:
$ date +F_%T%z 2017-06-29_17:44:25-0700
This is not strictly compliant with RFC3339, so might be different than what kernelCI expects, but I have reasons for my deviations.
Quoted 10 lines
3) Others
Quoted 4 lines
Quoted 2 lines
"metadata":{ "fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",Can we do these with 'git describe' strings instead?
ex: "fuego_version":"v1.1-24-g5ad677b"Sure, JSON schema allows expressing the format with regular expressions. Should I add one?
Just a raw string is fine. I don't want to impose too much structure. I would just like to have it be more human readable than a raw hash.
-- Tim
Quoted 2 lines
I'm working on a patch that uses timestamps in the following format:
$ date +F_%T%z
That should be '+%F_%T%z'. I really should cut-and-paste, instead of retyping lines, in my examples.
Quoted 1 line
2017-06-29_17:44:25-0700
-- Tim
Hi Tim,
Thanks for the review. Here is the new version. Hopefully I included everything you mentioned.
Note: this time I have used measures at [1] for redacting bonnie's results. By the way I noticed that bonnie is also a great example for the need of measurements.
I have enforced the "name" property for the test suite, the test sets, the test cases and the measurements. If we put a rule saying that "names" should not contain dots ('.') then we can create a TGUI that makes sense such as:
Benchmark.bonnie. Sequential_Output.PerChr.speed
For simple tests, it's a bit cumbersome but we just repeat the test suite name:
Benchmark.Dhrystone. Dhrystone. Dhrystone
What do you think?
Thanks,
Daniel
[1] http://support.commgate.net/index.php?/Knowledgebase/Article/View/212
*** fuego-schema.json ***
{
"$schema":"http://json-schema.org/schema#",
"id":"http://www.fuegotest.org/download/fuego_schema_v1.0.json",
"title":"test_suite",
"description":"A test suite JSON object corresponding to a single Fuego job run or execution",
"definitions":{
"status":{
"type":"string",
"description":"The status of the execution of this test case",
"enum":[
"PASS",
"FAIL",
"SKIP",
"ERROR"
]
},
"measurement":{
"title":"measurement",
"description":"A measurement registered by a test case",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"The name given to this measurement"
},
"unit":{
"type":"string",
"description":"The unit of this measurement"
},
"measure":{
"type":[
"string",
"number",
"integer"
],
"description":"The data measured during the test case execution; the value will be interpreted based on the $unit field"
},
"status":{
"$ref":"#/definitions/status"
},
"reference":{
"type":"object",
"description":"Reference measure that is compared to a measure to decide the status",
"properties":{
"threshold":{
"type":[
"string",
"number",
"integer"
],
"description":"A threshold value"
},
"comparison":{
"type":"string",
"description":"Type of comparison",
"enum":[
"eq",
"ne",
"gt",
"ge",
"lt",
"le"
]
}
},
"required":[
"threshold",
"comparison"
]
}
},
"required":[
"name",
"measure"
]
},
"attachment":{
"title":"attachment",
"description":"the location of a file",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"The name given to the attachment"
},
"server_uri":{
"type":"string",
"description":"A URI that points to this attachment"
},
"path":{
"type":"string",
"description":"A path in the test results package that identifies this attachment"
}
},
"required":[
"path"
]
},
"test_case":{
"type":"object",
"description":"A test case is the smallest test program",
"properties":{
"name":{
"type":"string",
"description":"The name given to this test case"
},
"status":{
"$ref":"#/definitions/status"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute this test case"
},
"measurements":{
"type":"array",
"description":"Array of measurement objects registered by this test case",
"items":{
"$ref":"#/definitions/measurement"
}
},
"attachments":{
"type":"array",
"description":"List of attachment objects produced by this test case",
"items":{
"$ref":"#/definitions/attachment"
},
"additionalItems":true
}
},
"required":[
"name",
"status"
]
},
"test_set":{
"title":"test_set",
"description":"A test set is a group of test cases",
"type":"object",
"properties":{
"name":{
"type":"string",
"description":"The name given to this test set"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute the test set"
},
"test_case":{
"type":"array",
"description":"The list of test case objects executed by this test set",
"items":{
"$ref":"#/definitions/test_case"
}
},
"test_set":{
"type":"array",
"description":"Nested test set",
"items":{
"$ref":"#/definitions/test_set"
}
}
},
"required":[
"name"
]
}
},
"type":"object",
"properties":{
"schema_version":{
"type":"string",
"description":"The version number of this JSON schema",
"enum":[
"1.0"
]
},
"name":{
"type":"string",
"description":"The name given to this test suite"
},
"status":{
"$ref":"#/definitions/status"
},
"duration_ms":{
"type":"number",
"description":"The number of ms it took to execute the entire test suite"
},
"test_set":{
"type":"array",
"description":"The list of test set objects, executed by this test suite",
"items":{
"$ref":"#/definitions/test_set"
}
},
"test_case":{
"type":"array",
"description":"List of test case objects when they do not belong to a test set",
"items":{
"$ref":"#/definitions/test_case"
}
},
"metadata":{
"type":"object",
"description":"Object to store Fuego parameters and other accessory data",
"properties":{
"fuego_version":{
"type":"string",
"description":"The version of fuego (e.g. v1.1-9234a234)"
},
"fuego_core_version":{
"type":"string",
"description":"The version of fuego core (e.g. v1.1-234544ac)"
},
"testsuite_version":{
"type":"string",
"description":"string that identifies the testsuite source code (e.g. repo:commit_id, tarball version..)"
},
"host_name":{
"type":"string",
"description":"The name of the host executing this test suite"
},
"board_type":{
"type":"string",
"description":"The name of the board"
},
"board_instance":{
"type":"string",
"description":"The instance identifier of the board (for LAVA)"
},
"compiled_on":{
"type":"string",
"description":"The machine where the test was compiled"
},
"job_name":{
"type":"string",
"description":"The name of the job"
},
"kernel_version":{
"type":"string",
"description":"The version of the kernel running on the board"
},
"start_time":{
"type":"string",
"description":"timestamp (e.g.: 2017-06-29_17:44:25-0700) when the test suite execution was started"
},
"test_plan":{
"type":"string",
"description":"The test plan used"
},
"test_spec":{
"type":"string",
"description":"The test spec used"
},
"build_number":{
"type":"number",
"description":"The build number"
},
"keep_log":{
"type":"boolean",
"description":"The keep_log flag"
},
"reboot":{
"type":"boolean",
"description":"The reboot flag"
},
"rebuild":{
"type":"boolean",
"description":"The rebuild flag"
},
"target_precleanup":{
"type":"boolean",
"description":"The target_precleanup flag"
},
"target_postcleanup":{
"type":"boolean",
"description":"The target_postcleanup flag"
},
"workspace":{
"type":"string",
"description":"The workspace path"
},
"attachments":{
"type":"array",
"description":"List of attachment objects produced by this test suite",
"items":{
"$ref":"#/definitions/attachment"
},
"additionalItems":true
}
},
"required":[
"fuego_version",
"host_name",
"board_type",
"job_name",
"test_spec",
"start_time"
]
}
},
"required":[
"schema_version",
"name",
"status",
"metadata"
]
}*** fuego-run-example-bonnie.json ***
{
"schema_version":"1.0",
"name":"Benchmark.bonnie",
"status":"PASS",
"duration_ms":118352,
"test_set":[
{
"name":"Sequential_Output",
"status":"PASS",
"test_case":[
{
"name":"Block",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":31483,
"unit":"K/Sec"
},
{
"name":"CPU",
"measure":43,
"unit":"%CPU"
},
{
"name":"latency",
"measure":770,
"unit":"ms"
}
]
},
{
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":400,
"unit":"K/Sec"
},
{
"name":"CPU",
"measure":98,
"unit":"%CPU"
},
{
"name":"latency",
"measure":24636,
"unit":"us"
}
]
},
{
"name":"Rewrite",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":35716,
"unit":"K/Sec"
},
{
"name":"CPU",
"measure":31,
"unit":"%CPU"
},
{
"name":"latency",
"measure":686,
"unit":"ms"
}
]
}
]
},
{
"name":"Sequential_Input",
"status":"PASS",
"test_case":[
{
"name":"PerChr",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":31928,
"unit":"K/Sec"
},
{
"name":"CPU",
"measure":97,
"unit":"%CPU"
},
{
"name":"latency",
"measure":57343,
"unit":"us"
}
]
},
{
"name":"Block",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":110644,
"unit":"K/Sec"
},
{
"name":"CPU",
"measure":36,
"unit":"%CPU"
},
{
"name":"latency",
"measure":50657,
"unit":"us"
}
]
}
]
},
{
"name":"Random_Seeks",
"status":"PASS",
"test_case":[
{
"name":"Random_Seeks",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":136.3,
"unit":"/Sec"
},
{
"name":"CPU",
"measure":792,
"unit":"%CPU"
},
{
"name":"latency",
"measure":1289,
"unit":"ms"
}
]
}
]
},
{
"name":"Sequential_Create",
"status":"PASS",
"test_case":[
{
"name":"Create",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":23913,
"unit":"/sec"
},
{
"name":"CPU",
"measure":60,
"unit":"%CPU"
},
{
"name":"latency",
"measure":1312,
"unit":"us"
}
]
},
{
"name":"Read",
"status":"PASS",
"measurements":[
{
"name":"latency",
"measure":1327,
"unit":"us"
}
]
},
{
"name":"Delete",
"status":"PASS",
"measurements":[
{
"name":"latency",
"measure":1093,
"unit":"us"
}
]
}
]
},
{
"name":"Random_Create",
"status":"PASS",
"test_case":[
{
"name":"Create",
"status":"PASS",
"measurements":[
{
"name":"speed",
"measure":31928,
"unit":"/Sec"
},
{
"name":"CPU",
"measure":64,
"unit":"%CPU"
},
{
"name":"latency",
"measure":346,
"unit":"us"
}
]
},
{
"name":"Read",
"status":"PASS",
"measurements":[
{
"name":"latency",
"measure":126,
"unit":"us"
}
]
},
{
"name":"Delete",
"status":"PASS",
"measurements":[
{
"name":"latency",
"measure":685,
"unit":"us"
}
]
}
]
}
],
"metadata":{
"fuego_version":"v1.1-5ad677b",
"fuego_core_version":"v1.1-805adb0",
"testsuite_version":"bonnie++-1.03e.tar.gz",
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"bbb.default.Benchmark.bonnie",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-30_11:53:50+0900",
"toolchain":"qemu-armv7hf",
"build_number":1,
"keep_log":true,
"reboot":false,
"rebuild":true,
"target_precleanup":true,
"target_postcleanup":true,
"workspace":"/fuego-rw/buildzone",
"attachments":[
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"syslog.before",
"path":"syslog.before.txt"
},
{
"name":"syslog.after",
"path":"syslog.after.txt"
},
{
"name":"testlog",
"path":"testlog.txt"
},
{
"name":"consolelog",
"path":"consolelog.txt"
},
{
"name":"test_spec",
"path":"spec.json"
}
]
}
}*** fuego-run-example-dhryston.json ***
{
"schema_version":"1.0",
"name":"Benchmark.Dhrystone",
"status":"PASS",
"duration_ms":13425,
"test_case":[
{
"name":"Dhrystone",
"status":"PASS",
"duration_ms":13400,
"measurements":[
{
"name": "Dhrystone",
"measure":1111111.1,
"unit":"Dhrystones per Second",
"status":"PASS",
"reference":{
"threshold":"1",
"comparison":"gt"
}
}
]
}
],
"metadata":{
"fuego_version":"v1.1-5ad677b",
"fuego_core_version":"v1.1-805adb0",
"testsuite_version":"Dhrystone.tar.bz2 with dhry_1.c.patch",
"host_name":"daniel_machine_3",
"board_type":"bbb",
"compiled_on":"daniel_machine_3.docker",
"job_name":"bbb.default.Benchmark.Dhrystone",
"kernel_version":"3.8.13-bone79",
"test_plan":"none",
"test_spec":"default",
"start_time":"2017-06-30_11:53:50+0900",
"toolchain":"qemu-armv7hf",
"build_number":4,
"keep_log":true,
"reboot":false,
"rebuild":true,
"target_precleanup":true,
"target_postcleanup":true,
"workspace":"/fuego-rw/buildzone",
"attachments":[
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"devlog",
"path":"devlog.txt"
},
{
"name":"syslog.before",
"path":"syslog.before.txt"
},
{
"name":"syslog.after",
"path":"syslog.after.txt"
},
{
"name":"testlog",
"path":"testlog.txt"
},
{
"name":"consolelog",
"path":"consolelog.txt"
},
{
"name":"test_spec",
"path":"spec.json"
}
]
}
}Quoted 162 lines
-----Original Message-----
From: Bird, Timothy [mailto:[email protected]]
Sent: Friday, June 30, 2017 9:48 AM
To: Daniel Sangorrin; 'Milo Casagrande'; [email protected]
Subject: RE: [Fuego] JSON schema and examples for Fuego's run.json formatQuoted 49 lines
-----Original Message-----
From: Daniel Sangorrin [mailto:[email protected]]
Sent: Thursday, June 29, 2017 5:24 PM
To: Bird, Timothy <[email protected]>; 'Milo Casagrande' <[email protected]>; [email protected]
Subject: RE: [Fuego] JSON schema and examples for Fuego's run.json formatHi Tim,
Thanks for your review. Before I modify the schema I want to confirm a few items.
1) tguids
Quoted 6 lines
Quoted 4 lines
"tguid":{ "type":"string", "description":"Fuego's test globally unique identifier" },Hey - thanks! But this would only be a partial tguid. Each individual
measurement
Quoted 1 line
should be able to be identified by a fully-qualified tguid (which maybe
consists
Quoted 1 line
of <this-tguid>.<test_set>.<test_case>.<measurement>
...
Quoted 7 lines
Quoted 3 lines
"test_case":[ { "tguid":"ab2344cfa34546564s234acfddddaaa2342",I want the tguid to be human readable, and invariant over runs. In this case, I think the tguid for the single-measurement item should be "Dhrystone.Dhrystone"
..
Quoted 6 lines
Quoted 2 lines
"tguid":"123a34546564s234acfddddaaa2342", "name":"Create",tguid would be: "bonnie.Random_Create.Create"
I think we can synthesize the tguid from the name fields. If it's
unambiguous
Quoted 5 lines
how to generate an invariant name for a test case/measure, then there's no need to have a separate field for the tguid.
The idea with TGUIDs is that we can compare them between test systems. As an example, I'd like to be able to compare a 0-day Dhrystone.Dhrystone
value
Quoted 2 lines
for the latest kernel with a Fuego Dhrystone.Dhrystone value for the LTSI kernel.
Quoted 6 lines
OK - based on your comments, I think that I should remove all "tguid" fields from the schema and
instead enforce (with the 'required' token) that all test suites/sets/cases/measures have
a name. This way we can just infer the TGUIDs from the names. What do you think?Agreed. I'm a bit worried about names not being globally invariant, based on supporting multiple "paths" to the testcase, depending on the structure of the tests and optional nesting of
test_sets.
e.g. Could LTP.syscall.kill10 end up being the same as LTP.RT-tests.functions.kill10? or could some super-test run LTP tests, resulting in a different string for the same test, like so: OpenTest.LTP.syscall.kill10?I'd say that for now, just make 'name' required, and we'll see what issues crop up and we start using it.
Quoted 3 lines
Milo (if you read this): do you see any specific reason for using a hash in Fuego as in Kernel CI?
What is the hash used for in KernelCI? It almost looks like a per-run value, instead of a per-test value.
Quoted 41 lines
2) timestamp format
Quoted 12 lines
Quoted 5 lines
"start_time":{ "type":"string", "description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when the test suite execution was started", "format":"date-time"This is a change, but it appears to be iso 8601-compliant. I'd rather not be required to express the start time in UTC. I think we should allow TimeZone offsets here (maybe you do). I like to see times in a locally-relevant time format. This is one of my chief gripes about Jenkins.
Quoted 3 lines
Quoted 1 line
"start_time":"2017-06-26T09:03:04Z",Is this actually in UTC, rather than localtime? Where are you getting this from? date? python time.time?
The "date-time" format is a built-in format in the JSON schema specification. It is
explained at [1] and can be used both in UTC and in local time.UTC example from [1]: 1985-04-12T23:20:50.52Z
This represents 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.Local time example from [1]: 1996-12-19T16:39:57-08:00
This represents 39 minutes and 57 seconds after the 16th hour of December 19th, 1996 with an offset of -08:00 from UTC (Pacific Standard Time). Note that this is equivalent to 1996-12-20T00:39:57Z in UTC.In python you can get local time in two ways:
With tzlocal (pip install tzlocal)
import tzlocal, datetime
d = datetime.datetime.now(tz=tzlocal.get_localzone()) printd.isoformat('T')
2017-06-30T09:13:27.507494+09:00Quoted 7 lines
With dateutil
import dateutil.tz, datetime
d = datetime.datetime.now(dateutil.tz.tzlocal()) printd.isoformat('T')
2017-06-30T09:13:27.507494+09:00The RFC3339 spec only allows 1 digit of fractional seconds, according to my reading of the spec. I believe ISO8601 allows more fractional seconds digits, but I'd like to stick to a strict subset of ISO8601 for the reasons mentioned in RFC3339. I dug into this today (in probably too much gory detail)
and Python and C support for RFC3339 is kind of messed up.See my notes on this at:
http://bird.org/fuego/Issue_0047I'm working on a patch that uses timestamps in the following format:
$ date +F_%T%z 2017-06-29_17:44:25-0700This is not strictly compliant with RFC3339, so might be different than what kernelCI expects, but I have reasons for my deviations.
Quoted 10 lines
3) Others
Quoted 4 lines
Quoted 2 lines
"metadata":{ "fuego_version":"0803ee7a2c5a59af159c01f561fc8d30d3d40e75",Can we do these with 'git describe' strings instead?
ex: "fuego_version":"v1.1-24-g5ad677b"Sure, JSON schema allows expressing the format with regular expressions. Should I add one?
Just a raw string is fine. I don't want to impose too much structure. I would just like to have it be more human readable than a raw hash.
-- Tim
Quoted 11 lines · Timothy
The RFC3339 spec only allows 1 digit of fractional seconds, according to my reading of the spec. I believe ISO8601 allows more fractional seconds digits, but I'd like to stick to a strict subset of ISO8601 for the reasons mentioned in RFC3339. I dug into this today (in probably too much gory detail)
and Python and C support for RFC3339 is kind of messed up.See my notes on this at:
http://bird.org/fuego/Issue_0047
Quoted 6 lines
I'm working on a patch that uses timestamps in the following format:
$ date +F_%T%z 2017-06-29_17:44:25-0700This is not strictly compliant with RFC3339, so might be different than what kernelCI expects, but I have reasons for my deviations.
Hmmm... I'm not sure I see the necessity for that deviation. That date string (with an underscore instead of the T character) will results in errors even in JavaScript.
Since it's JSON and it is based off JavaScript, the date format that JavaScript can expect is also based on a simplified version of
ISO8601: YYYY-MM-DDTHH:mm:ss.sssZ [1] (it also accepts an RFC2822 date format).
Although JSON is a human readable data format, it still is a machine data-interchange format. IMHO, I wouldn't deviate much from the expected format.
Application that uses the JSON data can then visualize the date (and the data in general) in a more human friendly way.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
Signature · 2 lines
Milo Casagrande Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
Quoted 31 lines
-----Original Message-----
From: Milo CasagrandeQuoted 11 lines · Timothy
The RFC3339 spec only allows 1 digit of fractional seconds, according to my reading of the spec. I believe ISO8601 allows more fractional seconds digits, but I'd like to stick to a strict subset of ISO8601 for the reasons mentioned in RFC3339. I dug into this today (in probably too much gory detail)
and Python and C support for RFC3339 is kind of messed up.See my notes on this at:
http://bird.org/fuego/Issue_0047Quoted 6 lines
I'm working on a patch that uses timestamps in the following format:
$ date +F_%T%z 2017-06-29_17:44:25-0700This is not strictly compliant with RFC3339, so might be different than what kernelCI expects, but I have reasons for my deviations.
Hmmm... I'm not sure I see the necessity for that deviation. That date string (with an underscore instead of the T character) will results in errors even in JavaScript.
Since it's JSON and it is based off JavaScript, the date format that JavaScript can expect is also based on a simplified version of
ISO8601: YYYY-MM-DDTHH:mm:ss.sssZ [1] (it also accepts an RFC2822 date format).
Quoted 5 lines
Although JSON is a human readable data format, it still is a machine data-interchange format. IMHO, I wouldn't deviate much from the expected format.
Application that uses the JSON data can then visualize the date (and the data in general) in a more human friendly way.
OK. Thanks for the info. I agree with your points. It looks like Javascript's strict interpretation of the date/time delimiter ('T') will trump my desire for a more white-spacey delimiter for human readability. I assume that Javascript can handle seconds with no fractional component?
I can always do a conversion of 'T' to '_' when the timestamp is used for directories or filenames, if it seems really important (which it doesn't at the moment).
As for the timezone offset, it's unclear to me whether the spec calls for colons or not.
According to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
Given a string representing a time, parse() returns the time value. It accepts the RFC2822 / IETF date syntax (RFC2822 Section 3.3), e.g. "Mon, 25 Dec 1995 13:30:00 GMT". It understands the continental US time zone abbreviations, but for general use, use a time zone offset, for example, "Mon, 25 Dec 1995 13:30:00 +0430" (4 hours, 30 minutes east of the Greenwich meridian).
(this example has no colon in the timezone offset)
----
According to https://tools.ietf.org/html/rfc2822#section-3.3
zone = (( "+" / "-" ) 4DIGIT) / obs-zone
(This spec is quite strict and does NOT use a colon.)
-------------
However,
According to http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15
Z is the time zone offset specified as “Z” (for UTC) or either “+” or “-” followed by a time expression HH:mm
(Note the use of a colon.)
-------------
Doing it without a colon is easiest from shell or python, but I'm not sure about Javascript.
What do the timestamps look like in kernelci - do they have colons or not in the timezone? Or are all times expressed in UTC ('Z') values?
------
Thanks very much for the feedback.
-- Tim
Quoted 6 lines · Timothy
OK. Thanks for the info. I agree with your points. It looks like Javascript's strict interpretation of the date/time delimiter ('T') will trump my desire for a more white-spacey delimiter for human readability. I assume that Javascript can handle seconds with no fractional component?
Yeah, it shouldn't be a problem.
Quoted 3 lines
(Note the use of a colon.)
-------------
Doing it without a colon is easiest from shell or python, but I'm not sure about Javascript.
Yeah, the spec says a "time format" (HH:mm), but even if the colon is not there, it's not a problem.
Quoted 2 lines
What do the timestamps look like in kernelci - do they have colons or not in the timezone? Or are all times expressed in UTC ('Z') values?
They are all UTC values.
I personally prefer to store them like that, in UTC, and let the visualization part adapt (if necessary) to the user needs, showing them with the user timezone or in other way.
Ciao.
Signature · 2 lines
Milo Casagrande Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
Quoted 6 lines · Daniel Sangorrin
OK - based on your comments, I think that I should remove all "tguid" fields from the schema and instead enforce (with the 'required' token) that all test suites/sets/cases/measures have a name. This way we can just infer the TGUIDs from the names.
What do you think?Milo (if you read this): do you see any specific reason for using a hash in Fuego as in Kernel CI?
I guess your "tguid" is what we refer to as "_id" in kernelci: that field is populated by the database, so we use it as our unique identifier for (almost) everything.
It's an easier way to identify (uniquely and fast) an item in the database, and at least for us it comes for free.
But for comparison purposes, you would indeed need a "name", or other fields, that you can use to identify the same test across multiple runs or different systems (plus of course other values that can help to identify the exact same test run on the exact same version of a kernel or a system).
For us it helps as well with the visualization part: it's easier to access the test data directly with it's ID rather than looking it up based on other values (plus indexing complexity at the database level).
Signature · 2 lines
Milo Casagrande Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
Quoted 4 lines
-----Original Message-----
From: Bird, Timothy on Thursday, June 29, 2017 3:17 PMQuoted 2 lines
-----Original Message-----
From: Daniel Sangorrin on Thursday, June 29, 2017 1:12 AM
...
Quoted 8 lines
Quoted 2 lines
"description":"timestamp (YYYY-MM-ddThh:mm:SSZ) when the
test suite execution was started",This is a change, but it appears to be iso 8601-compliant. I'd rather not be required to express the start time in UTC. I think we should allow TimeZone offsets here (maybe you do). I like to see times in a locally-relevant time format. This is one of my chief gripes about Jenkins.
Well, digging into this more, I found out that my gripe about Jenkins doing everything in UTC is actually an issue with Docker. Apparently there are some hoops you have to jump through to get Docker to use the timezone of the host inside the container. That would explain why all my Jenkins timestamps have been wrong (annoyingly so).
I'll try to figure out a solution for this, and let people know. Also, I've put in an issue for changing the timestamp field to something that is RFC3339-compliant. After looking at the issues, however, there may be slight deviations from RFC3339, due to issues in producing and parsing timezone data with standard POSIX routines (strftime, and strptime).
See http://bird.org/fuego/Issue_0047 for details.
-- Tim
Hi,
Quoted 11 lines · Daniel Sangorrin
Hi,
I have a preliminar schema for Fuego's run.json format and a couple of examples.
# run.json represents the result of running a test and the associated metadataThe schema is heavily based on Kernel CI's schemas. The main differences are:
- I have removed items that we don't need at the moment (kvm_guest...)
- I have defined several metadata items specific for fuego
- I have renamed some keys (e.g.:duration_msinstead of time)
- I have produced a single embedded schema instead of using references to other files
- I allow nesting test sets inside test sets
do you have an example of why this might be needed?
I can see the need to include multiple test sets in the same test suite...
Signature · 2 lines
Milo Casagrande Linaro.org <www.linaro.org> │ Open source software for ARM SoCs
Quoted 23 lines
-----Original Message-----
From: Milo Casagrande [mailto:[email protected]]
Sent: Friday, June 30, 2017 4:08 PM
To: Daniel Sangorrin
Cc: [email protected]; Bird, Timothy
Subject: Re: JSON schema and examples for Fuego's run.json formatHi,
Quoted 11 lines · Daniel Sangorrin
Hi,
I have a preliminar schema for Fuego's run.json format and a couple of examples.
# run.json represents the result of running a test and the associated metadataThe schema is heavily based on Kernel CI's schemas. The main differences are:
- I have removed items that we don't need at the moment (kvm_guest...)
- I have defined several metadata items specific for fuego
- I have renamed some keys (e.g.:duration_msinstead of time)
- I have produced a single embedded schema instead of using references to other files
- I allow nesting test sets inside test sets
Quoted 2 lines
do you have an example of why this might be needed?
I can see the need to include multiple test sets in the same test suite...
Let me explain each item.
Quoted 1 line
Quoted 1 line
- I have removed items that we don't need at the moment (
kvm_guest...)
This part is not strictly needed because the removed items were not "required". I removed them for readability so we know which parts are actually meaningful or used in Fuego at the moment.
Quoted 1 line
Quoted 1 line
- I have defined several metadata items specific for fuego
Here I am using the same keyword "metadata" as in Kernel CI.
I just added specific properties to metadata that are relevant
and required for fuego such as the fuego version, the test spec used etc.. This metadata is important for debugging and replaying a test (e.g. ftc replay run.json).
Quoted 1 line
Quoted 1 line
- I have renamed some keys (e.g.:
duration_msinstead of time)
I renamed some items because the meaning in Kernel CI and in Fuego was slightly different. For example, in Kernel CI time is a measurement in seconds, but in Fuego we are using milliseconds. The idea is that we can still convert Fuego's format to match kernel CI's schema (e.g. multiply by 1000).
Another example is vcs_commit, which is now testsuite_version. The reason is that not all tests will have a commit id, they can be just tarballs with a version number etc.
I also changed job_id to job_name and build_id to build_name to reuse Jenkins nomenclature. But these are not that important.
Quoted 1 line
Quoted 1 line
- I have produced a single embedded schema instead of using references to other files
This is to simplify our code. A single file is easier to manage. I believe Kernel CI also supports using single files.
Quoted 1 line
Quoted 1 line
- I allow nesting test sets inside test sets
I predict this will not be a very commonly used feature but I just added it for LTP.
I think I will have to go through some iterations but I think this is a good start, and Kernel CI's schemas were really useful to realize some of the possible needs (e.g. multiple measurements for a test case).
Thanks,
Daniel
Quoted 8 lines · Daniel Sangorrin
Let me explain each item.
Quoted 1 line
Quoted 1 line
- I have removed items that we don't need at the moment (
kvm_guest...)This part is not strictly needed because the removed items were not "required". I removed them for readability so we know which parts are actually meaningful or used in Fuego at the moment.
Yeah, that's absolutely fine and necessary I guess.
I don't expect the kernelci test schemas to be uses as is for all use cases.
Quoted 6 lines
Quoted 1 line
Quoted 1 line
- I have defined several metadata items specific for fuego
Here I am using the same keyword "metadata" as in Kernel CI.
I just added specific properties to metadata that are relevant
and required for fuego such as the fuego version, the test spec used etc.. This metadata is important for debugging and replaying a test (e.g. ftc replay run.json).
I think the "metadata" field in kernelci is a free-form object to store whatever else is necessary, then it's up to the "applications" (visualization) to make something meaningful with it.
Quoted 5 lines
Quoted 1 line
Quoted 1 line
- I have renamed some keys (e.g.:
duration_msinstead of time)I renamed some items because the meaning in Kernel CI and in Fuego was slightly different. For example, in Kernel CI time is a measurement in seconds, but in Fuego we are using milliseconds. The idea is that we can still convert Fuego's format to match kernel CI's schema (e.g. multiply by 1000).
This is a good point, and I don't see why we shouldn't change the format on kernelci side.
I'll have to check, but I don't think it will be a problem, and it makes sense.
Quoted 2 lines
I also changed
job_idtojob_nameandbuild_idtobuild_nameto reuse Jenkins nomenclature. But these are not that important.
Those fields, are tightly coupled with the other parts of kernelci. Since we have, for each elements stored in the database, an "_id" field, the "job_id", "build_id", etc... are internal references to the "_id" field of a "job" resource, etc... They definitely are not Jenkins related.
Quoted 4 lines
Quoted 1 line
Quoted 1 line
- I have produced a single embedded schema instead of using references to other files
This is to simplify our code. A single file is easier to manage. I believe Kernel CI also supports using single files.
Yeah, you can just "embed" everything into a single JSON object, or you can split it up, it's mostly up to the test runners (or better, who has to write the code to dump the result into that format and send them to kernelci).
Quoted 3 lines
I think I will have to go through some iterations but I think this is a good start, and Kernel CI's schemas were really useful to realize some of the possible needs (e.g. multiple measurements for a test case).
Glad they could be of help!
Ciao.
Signature · 2 lines
Milo Casagrande Linaro.org <www.linaro.org> │ Open source software for ARM SoCs