-
Notifications
You must be signed in to change notification settings - Fork 191
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 support for gauge #127
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, just one question!
// Smoke tests for Grafana's singlestat panel. | ||
func TestGaugePanel(t *testing.T) { | ||
// Creating a dashboard using json model | ||
dashboardModelStr := "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": true,\n \"gnetId\": null,\n \"graphTooltip\": 0,\n \"id\": 2,\n \"links\": [],\n \"panels\": [\n {\n \"datasource\": \"-- Grafana --\",\n \"fieldConfig\": {\n \"defaults\": {\n \"custom\": {},\n \"mappings\": [],\n \"thresholds\": {\n \"mode\": \"absolute\",\n \"steps\": [\n {\n \"color\": \"green\",\n \"value\": null\n },\n {\n \"color\": \"red\",\n \"value\": 80\n }\n ]\n }\n },\n \"overrides\": []\n },\n \"gridPos\": {\n \"h\": 9,\n \"w\": 12,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 2,\n \"options\": {\n \"reduceOptions\": {\n \"calcs\": [\n \"mean\"\n ],\n \"fields\": \"\",\n \"values\": false\n },\n \"showThresholdLabels\": false,\n \"showThresholdMarkers\": true\n },\n \"pluginVersion\": \"7.3.6\",\n \"targets\": [\n {\n \"queryType\": \"randomWalk\",\n \"refId\": \"A\"\n }\n ],\n \"timeFrom\": null,\n \"timeShift\": null,\n \"title\": \"Panel Title\",\n \"type\": \"gauge\"\n }\n ],\n \"schemaVersion\": 26,\n \"style\": \"dark\",\n \"tags\": [],\n \"templating\": {\n \"list\": []\n },\n \"time\": {\n \"from\": \"now-6h\",\n \"to\": \"now\"\n },\n \"timepicker\": {},\n \"timezone\": \"\",\n \"title\": \"gaugetest\",\n \"uid\": \"gauge\",\n \"version\": 1\n}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I have some issues making my test case work with chromedp. Hope you could give some advice regarding that.
Were you talking about this part specifically? Is there any reason you've added the raw JSON here instead of using the functions to "construct" this board?
Is there anything I can do to help get this merged? |
Feel free! Just convert the tests to use sdk's functions instead of pure strings and we can get this merged (: |
I tested the functionality on my own project and it's working.
However, I have some issues making my test case work with chromedp. Hope you could give some advice regarding that.
Closes #126