浏览代码

moves /tests to /pkg/plugins

ref #11433
bergquist 7 年之前
父节点
当前提交
8dbba467f1

+ 2 - 2
pkg/plugins/dashboard_importer_test.go

@@ -35,7 +35,7 @@ func TestDashboardImport(t *testing.T) {
 			So(cmd.Result, ShouldNotBeNil)
 
 			resultStr, _ := mock.SavedDashboards[0].Dashboard.Data.EncodePretty()
-			expectedBytes, _ := ioutil.ReadFile("../../tests/test-app/dashboards/connections_result.json")
+			expectedBytes, _ := ioutil.ReadFile("testdata/test-app/dashboards/connections_result.json")
 			expectedJson, _ := simplejson.NewJson(expectedBytes)
 			expectedStr, _ := expectedJson.EncodePretty()
 
@@ -89,7 +89,7 @@ func pluginScenario(desc string, t *testing.T, fn func()) {
 	Convey("Given a plugin", t, func() {
 		setting.Raw = ini.Empty()
 		sec, _ := setting.Raw.NewSection("plugin.test-app")
-		sec.NewKey("path", "../../tests/test-app")
+		sec.NewKey("path", "testdata/test-app")
 
 		pm := &PluginManager{}
 		err := pm.Init()

+ 1 - 1
pkg/plugins/dashboards_test.go

@@ -16,7 +16,7 @@ func TestPluginDashboards(t *testing.T) {
 	Convey("When asking plugin dashboard info", t, func() {
 		setting.Raw = ini.Empty()
 		sec, _ := setting.Raw.NewSection("plugin.test-app")
-		sec.NewKey("path", "../../tests/test-app")
+		sec.NewKey("path", "testdata/test-app")
 
 		pm := &PluginManager{}
 		err := pm.Init()

+ 1 - 1
pkg/plugins/plugins_test.go

@@ -30,7 +30,7 @@ func TestPluginScans(t *testing.T) {
 	Convey("When reading app plugin definition", t, func() {
 		setting.Raw = ini.Empty()
 		sec, _ := setting.Raw.NewSection("plugin.nginx-app")
-		sec.NewKey("path", "../../tests/test-app")
+		sec.NewKey("path", "testdata/test-app")
 
 		pm := &PluginManager{}
 		err := pm.Init()

+ 0 - 0
tests/datasource-test/module.js → pkg/plugins/testdata/datasource-test/module.js


+ 0 - 0
tests/datasource-test/plugin.json → pkg/plugins/testdata/datasource-test/plugin.json


+ 0 - 0
tests/test-app/dashboards/connections.json → pkg/plugins/testdata/test-app/dashboards/connections.json


+ 0 - 0
tests/test-app/dashboards/connections_result.json → pkg/plugins/testdata/test-app/dashboards/connections_result.json


+ 0 - 0
tests/test-app/dashboards/memory.json → pkg/plugins/testdata/test-app/dashboards/memory.json


+ 0 - 0
tests/test-app/plugin.json → pkg/plugins/testdata/test-app/plugin.json