-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Allow offline providers * Fix tests * Add an integration test * simplify (as per PR suggestion) * Lint
- Loading branch information
1 parent
4dc308b
commit 241cea4
Showing
17 changed files
with
114 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package integration_test | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestEmptyProviders(t *testing.T) { | ||
dir := "testdata/providers" | ||
setupContexts(t, dir) | ||
|
||
t.Run("Providers work for offline commands", func(t *testing.T) { | ||
runTest(t, GrizzlyTest{ | ||
TestDir: dir, | ||
Commands: []Command{ | ||
{ | ||
Command: "config use-context empty", | ||
ExpectedCode: 0, | ||
}, | ||
{ | ||
Command: "show folder.yaml", | ||
ExpectedCode: 0, | ||
ExpectedOutputFile: "folder-output.txt", | ||
}, | ||
}, | ||
}) | ||
}) | ||
|
||
t.Run("Providers fail online commands without configs", func(t *testing.T) { | ||
runTest(t, GrizzlyTest{ | ||
TestDir: dir, | ||
Commands: []Command{ | ||
{ | ||
Command: "config use-context empty", | ||
}, | ||
{ | ||
Command: "apply folder.yaml", | ||
ExpectedCode: 1, | ||
}, | ||
}, | ||
}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
basic_auth | ||
* default | ||
empty | ||
invalid_auth | ||
subpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DashboardFolder.sample: | ||
apiVersion: grizzly.grafana.com/v1alpha1 | ||
kind: DashboardFolder | ||
metadata: | ||
name: sample | ||
spec: | ||
title: Sample Folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: grizzly.grafana.com/v1alpha1 | ||
kind: DashboardFolder | ||
metadata: | ||
name: sample | ||
spec: | ||
title: Sample Folder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters