monitoring(testing): make branch filter static
This commit is contained in:
parent
974955ac83
commit
f2ae3c1b0c
@ -601,6 +601,7 @@ PLATFORM_TEST_OVERVIEW_CATEGORY_REGEX = (
|
||||
"performance|regression|reliability|security|smoke|system|ui"
|
||||
)
|
||||
PLATFORM_TEST_SUPPORT_CATEGORY_REGEX = "fixtures|golden|helpers"
|
||||
PLATFORM_TEST_BRANCH_OPTIONS = ("main", "master", "origin/main", "origin/master", "unknown")
|
||||
PLATFORM_TEST_RUNS_24H_ROLLUP = "platform_quality:suite_runs:increase_24h"
|
||||
PLATFORM_TEST_COVERAGE_ROLLUP = "platform_quality:suite_coverage_percent:latest_1h"
|
||||
PLATFORM_TEST_SOURCE_FILES_ROLLUP = "platform_quality:suite_source_files_total:latest_1h"
|
||||
@ -1495,19 +1496,28 @@ def testing_case_variable():
|
||||
|
||||
|
||||
def testing_branch_variable():
|
||||
options = [
|
||||
{
|
||||
"text": branch,
|
||||
"value": branch,
|
||||
"selected": False,
|
||||
}
|
||||
for branch in PLATFORM_TEST_BRANCH_OPTIONS
|
||||
]
|
||||
query = ",".join(f"{branch} : {branch}" for branch in PLATFORM_TEST_BRANCH_OPTIONS)
|
||||
return {
|
||||
"name": "branch",
|
||||
"label": "Branch",
|
||||
"type": "query",
|
||||
"query": f'label_values(platform_quality_gate_build_info{{suite=~"${{suite:regex}}",branch!="",{PLATFORM_TEST_EXPORT_FILTER}}}, branch)',
|
||||
"type": "custom",
|
||||
"query": query,
|
||||
"current": {"text": "All", "value": "$__all", "selected": True},
|
||||
"options": [],
|
||||
"options": options,
|
||||
"hide": 0,
|
||||
"multi": False,
|
||||
"includeAll": True,
|
||||
"allValue": ".*",
|
||||
"refresh": 2,
|
||||
"sort": 1,
|
||||
"refresh": 0,
|
||||
"sort": 0,
|
||||
"skipUrlSync": False,
|
||||
}
|
||||
|
||||
|
||||
@ -225,6 +225,11 @@ def test_jobs_dashboard_separates_current_gate_health_from_reliability():
|
||||
assert "platform_quality:test_case_health_rate:percent_1h" in test_variable["query"]
|
||||
assert "platform_quality_gate_test_case_result" not in test_variable["query"]
|
||||
assert test_variable["regex"] == '/test="([^"]+)"/'
|
||||
branch_variable = variables_by_name["branch"]
|
||||
assert branch_variable["type"] == "custom"
|
||||
assert branch_variable["allValue"] == ".*"
|
||||
assert "platform_quality_gate_build_info" not in branch_variable["query"]
|
||||
assert "origin/main : origin/main" in branch_variable["query"]
|
||||
|
||||
assert "Current Gate Health (%)" in panels_by_title
|
||||
assert "Suite Freshness (24h)" in panels_by_title
|
||||
|
||||
@ -4787,20 +4787,46 @@
|
||||
{
|
||||
"name": "branch",
|
||||
"label": "Branch",
|
||||
"type": "query",
|
||||
"query": "label_values(platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",exported_job=\"platform-quality-ci\"}, branch)",
|
||||
"type": "custom",
|
||||
"query": "main : main,master : master,origin/main : origin/main,origin/master : origin/master,unknown : unknown",
|
||||
"current": {
|
||||
"text": "All",
|
||||
"value": "$__all",
|
||||
"selected": true
|
||||
},
|
||||
"options": [],
|
||||
"options": [
|
||||
{
|
||||
"text": "main",
|
||||
"value": "main",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "master",
|
||||
"value": "master",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "origin/main",
|
||||
"value": "origin/main",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "origin/master",
|
||||
"value": "origin/master",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "unknown",
|
||||
"value": "unknown",
|
||||
"selected": false
|
||||
}
|
||||
],
|
||||
"hide": 0,
|
||||
"multi": false,
|
||||
"includeAll": true,
|
||||
"allValue": ".*",
|
||||
"refresh": 2,
|
||||
"sort": 1,
|
||||
"refresh": 0,
|
||||
"sort": 0,
|
||||
"skipUrlSync": false
|
||||
},
|
||||
{
|
||||
|
||||
@ -4796,20 +4796,46 @@ data:
|
||||
{
|
||||
"name": "branch",
|
||||
"label": "Branch",
|
||||
"type": "query",
|
||||
"query": "label_values(platform_quality_gate_build_info{suite=~\"${suite:regex}\",branch!=\"\",exported_job=\"platform-quality-ci\"}, branch)",
|
||||
"type": "custom",
|
||||
"query": "main : main,master : master,origin/main : origin/main,origin/master : origin/master,unknown : unknown",
|
||||
"current": {
|
||||
"text": "All",
|
||||
"value": "$__all",
|
||||
"selected": true
|
||||
},
|
||||
"options": [],
|
||||
"options": [
|
||||
{
|
||||
"text": "main",
|
||||
"value": "main",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "master",
|
||||
"value": "master",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "origin/main",
|
||||
"value": "origin/main",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "origin/master",
|
||||
"value": "origin/master",
|
||||
"selected": false
|
||||
},
|
||||
{
|
||||
"text": "unknown",
|
||||
"value": "unknown",
|
||||
"selected": false
|
||||
}
|
||||
],
|
||||
"hide": 0,
|
||||
"multi": false,
|
||||
"includeAll": true,
|
||||
"allValue": ".*",
|
||||
"refresh": 2,
|
||||
"sort": 1,
|
||||
"refresh": 0,
|
||||
"sort": 0,
|
||||
"skipUrlSync": false
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user