Skip to content

Commit

Permalink
Reapplying dashboards fails (#353)
Browse files Browse the repository at this point in the history
* Reapplying dashboards fails

* Correct test, add another

* Add required test file
  • Loading branch information
malcolmholmes authored Feb 28, 2024
1 parent 3890263 commit 9d7ae73
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
34 changes: 34 additions & 0 deletions integration/dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,40 @@ func TestDashboard(t *testing.T) {
})
})

t.Run("Re-apply dashboard - no folder", func(t *testing.T) {
runTest(t, GrizzlyTest{
TestDir: dir,
RunOnContexts: allContexts,
Commands: []Command{
{
Command: "apply no-folder.yml",
ExpectedOutput: "Dashboard.no-folder no differences\n",
},
{
Command: "get Dashboard.no-folder",
ExpectedOutputContains: "folder: general",
},
},
})
})

t.Run("Re-apply changed dashboard - no folder", func(t *testing.T) {
runTest(t, GrizzlyTest{
TestDir: dir,
RunOnContexts: allContexts,
Commands: []Command{
{
Command: "apply no-folder-mk2.yml",
ExpectedOutput: "Dashboard.no-folder updated\n",
},
{
Command: "get Dashboard.no-folder",
ExpectedOutputContains: "folder: general",
},
},
})
})

t.Run("Diff dashboard - success", func(t *testing.T) {
runTest(t, GrizzlyTest{
TestDir: dir,
Expand Down
12 changes: 12 additions & 0 deletions integration/testdata/dashboards/no-folder-mk2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: grizzly.grafana.com/v1alpha1
kind: Dashboard
metadata:
name: no-folder
spec:
schemaVersion: 17
tags:
- templated
timezone: browser
title: No Folder
uid: no-folder
editable: true

0 comments on commit 9d7ae73

Please sign in to comment.