Revert "Bug 1295536 - Validate that perfherder values are within acceptable ranges" (#1788)

Reverts mozilla/treeherder#1786, due to:
https://bugzilla.mozilla.org/show_bug.cgi?id=1295536#c9
This commit is contained in:
Ed Morley 2016-08-17 00:02:02 +01:00 коммит произвёл GitHub
Родитель 07db3a801b
Коммит 8858fc1443
2 изменённых файлов: 10 добавлений и 61 удалений

Просмотреть файл

@ -18,9 +18,7 @@
"value": { "value": {
"description": "Summary value for subtest", "description": "Summary value for subtest",
"title": "Subtest value", "title": "Subtest value",
"type": "number", "type": "number"
"minimum": -1000000000.0,
"maximum": 1000000000.0
}, },
"lowerIsBetter": { "lowerIsBetter": {
"description": "Whether lower values are better for subtest", "description": "Whether lower values are better for subtest",
@ -35,30 +33,22 @@
"alertThreshold": { "alertThreshold": {
"description": "% change threshold before alerting", "description": "% change threshold before alerting",
"title": "Alert threshold", "title": "Alert threshold",
"type": "number", "type": "number"
"minimum": 0.0,
"maximum": 1000.0
}, },
"minBackWindow": { "minBackWindow": {
"description": "Minimum back window to use for alerting", "description": "Minimum back window to use for alerting",
"title": "Minimum back window", "title": "Minimum back window",
"type": "number", "type": "number"
"minimum": 1,
"maximum": 255
}, },
"maxBackWindow": { "maxBackWindow": {
"description": "Maximum back window to use for alerting", "description": "Maximum back window to use for alerting",
"title": "Maximum back window", "title": "Maximum back window",
"type": "number", "type": "number"
"minimum": 1,
"maximum": 255
}, },
"foreWindow": { "foreWindow": {
"description": "Fore window to use for alerting", "description": "Fore window to use for alerting",
"title": "Fore window", "title": "Fore window",
"type": "number", "type": "number"
"minimum": 1,
"maximum": 255
} }
}, },
"required": [ "required": [
@ -90,9 +80,7 @@
}, },
"value": { "value": {
"title": "Suite value", "title": "Suite value",
"type": "number", "type": "number"
"minimum": -1000000000.0,
"maximum": 1000000000.0
}, },
"lowerIsBetter": { "lowerIsBetter": {
"description": "Whether lower values are better for suite", "description": "Whether lower values are better for suite",
@ -107,30 +95,22 @@
"alertThreshold": { "alertThreshold": {
"description": "% change threshold before alerting", "description": "% change threshold before alerting",
"title": "Alert threshold", "title": "Alert threshold",
"type": "number", "type": "number"
"minimum": 0.0,
"maximum": 1000.0
}, },
"minBackWindow": { "minBackWindow": {
"description": "Minimum back window to use for alerting", "description": "Minimum back window to use for alerting",
"title": "Minimum back window", "title": "Minimum back window",
"type": "integer", "type": "number"
"minimum": 1,
"maximum": 255
}, },
"maxBackWindow": { "maxBackWindow": {
"description": "Maximum back window to use for alerting", "description": "Maximum back window to use for alerting",
"title": "Maximum back window", "title": "Maximum back window",
"type": "integer", "type": "number"
"minimum": 1,
"maximum": 255
}, },
"foreWindow": { "foreWindow": {
"description": "Fore window to use for alerting", "description": "Fore window to use for alerting",
"title": "Fore window", "title": "Fore window",
"type": "integer", "type": "number"
"minimum": 1,
"maximum": 255
} }
}, },
"required": [ "required": [

Просмотреть файл

@ -1,31 +0,0 @@
import json
import jsonschema
import pytest
@pytest.mark.parametrize(('suite_value', 'test_value', 'expected_fail'),
[({}, {}, True),
({'value': 1234}, {}, True),
({}, {'value': 1234}, False),
({'value': 1234}, {'value': 1234}, False),
({'value': float('inf')}, {}, True),
({}, {'value': float('inf')}, True)])
def test_perf_schema(suite_value, test_value, expected_fail):
perf_schema = json.load(open('schemas/performance-artifact.json'))
datum = {
"framework": {"name": "talos"}, "suites": [{
"name": "basic_compositor_video",
"subtests": [{
"name": "240p.120fps.mp4_scale_fullscreen_startup"
}]
}]
}
datum['suites'][0].update(suite_value)
datum['suites'][0]['subtests'][0].update(test_value)
print datum
if expected_fail:
with pytest.raises(jsonschema.ValidationError):
jsonschema.validate(datum, perf_schema)
else:
jsonschema.validate(datum, perf_schema)