Re: [Automated-testing] KCIDB: Support non-binary test outputs V2
Nikolai Kondrashov <[email protected]>
| Newsgroups | dev.linux.lists.kernelci |
|---|---|
| Message-ID | <[email protected]> |
On 8/5/24 2:28 PM, Nikolai Kondrashov wrote:
>> I'll follow up with a separate message for each of the changes, going over the
>> details and the rationale.
>
> The support for non-binary test outputs introduces a new field to the "test"
> objects called "value", being an "object" itself. It (and its abstract
> meaning) are supposed to work together with the "status" field. That is, it
> should only be considered when the test has actually executed. I.e. with a
> "FAIL", "ERROR", "PASS", or "DONE" status only. Normally "DONE" should be
> used, when the value is the test's output, and not an auxiliary value.
Alright, I redid support for non-binary test outputs:
https://github.com/kernelci/kcidb-io/pull/85/commits/040a20db407f2592c28c3797cec9e4118221af9c
First, I dropped support for all the different types, and left only the
(signed) integer, requiring the receiving system to allocate at least 64 bits
to it. That integer is the only required field for the numeric output.
I also added the 10-based "exponent" field, to support "floating point"
numbers, although I suspect we would prefer fixed-point numbers (consistent
exponent) instead, as that makes the queries easier, at least for the start.
Then there's the "unit" field, which is just a string, and if "exponent" is
specified, then the "unit" is assumed to not contain any prefixes, and they
are generated on display, with the value appropriately scaled (that SQL
function will be interesting to write).
Finally, there's the "binary" field, and if it's true, then a binary prefix is
generated instead. That is, Ki, Mi, Gi, and so on. Naturally it's only
considered when both "exponent" and "unit" are specified.
Here's the abbreviated schema:
"number": {
"type": "object",
"properties": {
"value": {"type": "integer"},
"unit": {"type": "string"},
"exponent": {"type": "integer"},
"binary": {"type": "boolean"}
},
"required": ["value"],
"additionalProperties": False
}
The commit linked above has docs and examples. I'll reproduce the latter here
in shorter form:
"value": 42,
# Display: 42
"value": 314159,
"exponent": -5,
# Display: 3.14159
"value": 720,
"unit": "KB",
# Display: 720 KB
"value": 160,
"unit": "s",
"exponent": -9,
# Display: 160 ns
"value": 512,
"unit": "B",
"exponent": 3,
"binary": True,
# Display: 500 KiB
Tell me what you think, especially Tim, and Mark!
Thank you.
Nick