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 support for gauge #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tonykoh
Copy link

@tonykoh tonykoh commented Mar 3, 2021

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

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 47.036% when pulling 6f6fa6a on tonykoh:master into d230043 on grafana-tools:master.

Copy link
Collaborator

@GiedriusS GiedriusS left a 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}"
Copy link
Collaborator

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?

@phillebaba
Copy link
Contributor

Is there anything I can do to help get this merged?

@GiedriusS
Copy link
Collaborator

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 (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for gauge panel type
4 participants