Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a schema for wptreport.json #29259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
312 changes: 312 additions & 0 deletions docs/running-tests/wptreport-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,312 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "WptReport",
"type": "object",
"required": [
"results",
"run_info",
"time_end",
"time_start"
],
"properties": {
"lsan_leaks": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/LsanLeak"
}
},
"mozleak": {
"type": [
"object",
"null"
],
"additionalProperties": {
"$ref": "#/definitions/MozLeak"
}
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/TestResult"
}
},
"run_info": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgraham do we want to give some guarantees as to what appears in run_info?

Per

return RunInfo(metadata_root, product, **kwargs)
, the following always exist: python_version, product, verify, headless, and webrender(!!!!).

That said, looking through those I guess none of them are actually that useful in general… (product is, but it's of limited use without product version and OS)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think we do. It's kind of annoying, but I think we want to allow people to pass back empty run_info if they aren't comparing to other products/configurations. In practice specific expectation metadata does depend on specific properties exising, but the metadata isn't really terribly portable beyond the system it runs in, so that isn't obviously a sufficient justification for standardising this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not even just making it a nullable object?

Copy link
Contributor

@jgraham jgraham Jun 9, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the guarantee for RunInfo is that it's a Map<String, JsonValue> (in some Rustish syntax). I don't think it should be null but I don't think we can guarantee any specific fields.

"time_end": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"time_start": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"definitions": {
"AssertionCount": {
"type": "object",
"required": [
"count",
"max",
"min"
],
"properties": {
"count": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"max": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"min": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
}
},
"LsanLeak": {
"type": "object",
"required": [
"frames",
"scope"
],
"properties": {
"allowed_match": {
"type": [
"string",
"null"
]
},
"frames": {
"type": "array",
"items": {
"type": "string"
}
},
"scope": {
"type": "string"
}
}
},
"MozLeak": {
"type": "object",
"required": [
"objects",
"total"
],
"properties": {
"objects": {
"type": "array",
"items": {
"$ref": "#/definitions/MozLeakObject"
}
},
"total": {
"type": "array",
"items": {
"$ref": "#/definitions/MozLeakTotal"
}
}
}
},
"MozLeakObject": {
"type": "object",
"required": [
"allowed",
"bytes",
"name"
],
"properties": {
"allowed": {
"type": "boolean"
},
"bytes": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"name": {
"type": "string"
},
"process": {
"type": [
"string",
"null"
]
}
}
},
"MozLeakTotal": {
"type": "object",
"required": [
"bytes",
"threshold"
],
"properties": {
"bytes": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"process": {
"type": [
"string",
"null"
]
},
"threshold": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
},
"SubtestResult": {
"type": "object",
"required": [
"name",
"status"
],
"properties": {
"expected": {
"anyOf": [
{
"$ref": "#/definitions/SubtestStatus"
},
{
"type": "null"
}
]
},
"known_intermittent": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/SubtestStatus"
}
},
"message": {
"type": [
"string",
"null"
]
},
"name": {
"type": "string"
},
"status": {
"$ref": "#/definitions/SubtestStatus"
}
}
},
"SubtestStatus": {
"type": "string",
"enum": [
"PASS",
"FAIL",
"ERROR",
"TIMEOUT",
"ASSERT",
"NOTRUN",
"SKIP",
"PRECONDITION_FAILED"
]
},
"TestResult": {
"type": "object",
"required": [
"status",
"subtests",
"test"
],
"properties": {
"asserts": {
"anyOf": [
{
"$ref": "#/definitions/AssertionCount"
},
{
"type": "null"
}
]
},
"duration": {
"type": [
"integer",
"null"
],
"format": "int64"
},
"expected": {
"anyOf": [
{
"$ref": "#/definitions/TestStatus"
},
{
"type": "null"
}
]
},
"known_intermittent": {
"type": [
"array",
"null"
],
"items": {
"$ref": "#/definitions/TestStatus"
}
},
"message": {
"type": [
"string",
"null"
]
},
"reftest_screenshots": {
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "string"
}
},
"status": {
"$ref": "#/definitions/TestStatus"
},
"subtests": {
"type": "array",
"items": {
"$ref": "#/definitions/SubtestResult"
}
},
"test": {
"type": "string"
}
}
},
"TestStatus": {
"type": "string",
"enum": [
"PASS",
"FAIL",
"OK",
"ERROR",
"TIMEOUT",
"CRASH",
"ASSERT",
"SKIP",
"PRECONDITION_FAILED"
]
}
}
}