From f02241f8de9f374c378781c86e3ca2540b29b794 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 4 Jun 2018 15:51:41 +1000 Subject: [PATCH] Test case for multiple targets with hidden I was trying to figure out how to do multiple target calculations with hidden targets. I didn't see this explicitly tested for, so add it. Change-Id: Ibbbb2810dd531e792f11c07946c21829fcdbe0a1 --- tests/schema/fixtures/dashboard-0030.json | 58 +++++++++++++++++++++++ tests/schema/fixtures/dashboard-0030.yaml | 19 ++++++++ 2 files changed, 77 insertions(+) create mode 100644 tests/schema/fixtures/dashboard-0030.json create mode 100644 tests/schema/fixtures/dashboard-0030.yaml diff --git a/tests/schema/fixtures/dashboard-0030.json b/tests/schema/fixtures/dashboard-0030.json new file mode 100644 index 0000000..decec00 --- /dev/null +++ b/tests/schema/fixtures/dashboard-0030.json @@ -0,0 +1,58 @@ +{ + "dashboard": { + "new-dashboard": { + "rows": [ + { + "collapse": false, + "editable": true, + "height": "250px", + "panels": [ + { + "bars": false, + "datasource": "graphite", + "editable": true, + "error": false, + "fill": 1, + "lines": true, + "linewidth": 2, + "percentage": false, + "pointradius": 5, + "points": false, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "hide": true, + "refId": "A", + "target": "stats.gauges.afs.afs01_dfw_openstack_org.part.vicepa.total" + }, + { + "hide": false, + "refId": "B", + "target": "divideSeries(stats.gauges.afs.afs01_dfw_openstack_org.part.vicpa.used, #A)" + } + ], + "title": "no title (click here)", + "type": "graph", + "x-axis": true, + "y-axis": true + } + ], + "showTitle": false, + "title": "New row" + } + ], + "templating": { + "enabled": false, + "list": [] + }, + "time": { + "from": "2018-02-07T08:42:27.000Z", + "to": "2018-02-07T13:48:32.000Z" + }, + "timezone": "utc", + "title": "New dashboard" + } + } +} diff --git a/tests/schema/fixtures/dashboard-0030.yaml b/tests/schema/fixtures/dashboard-0030.yaml new file mode 100644 index 0000000..6fd6e3b --- /dev/null +++ b/tests/schema/fixtures/dashboard-0030.yaml @@ -0,0 +1,19 @@ +dashboard: + time: + from: "2018-02-07T08:42:27.000Z" + to: "2018-02-07T13:48:32.000Z" + title: New dashboard + rows: + - title: New row + height: 250px + panels: + - title: no title (click here) + type: graph + datasource: graphite + targets: + - target: "stats.gauges.afs.afs01_dfw_openstack_org.part.vicepa.total" + refId: "A" + hide: true + - target: "divideSeries(stats.gauges.afs.afs01_dfw_openstack_org.part.vicpa.used, #A)" + refId: "B" + hide: false