mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add vscode launcher to attach test process (#95718)
This commit is contained in:
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
@@ -16,6 +16,15 @@
|
|||||||
"cfg:app_mode=development",
|
"cfg:app_mode=development",
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Attach to Test Process",
|
||||||
|
"type": "go",
|
||||||
|
"request": "attach",
|
||||||
|
"mode": "remote",
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 50480,
|
||||||
|
"apiVersion": 2,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Run API Server (testdata)",
|
"name": "Run API Server (testdata)",
|
||||||
"type": "go",
|
"type": "go",
|
||||||
|
|||||||
@@ -163,6 +163,13 @@ func CreateGrafDir(t *testing.T, opts ...GrafanaOpts) (string, string) {
|
|||||||
dir, err := filepath.Abs(rootDir)
|
dir, err := filepath.Abs(rootDir)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
// When running within an enterprise test, we need to move to the grafana directory
|
||||||
|
if strings.HasSuffix(dir, "grafana-enterprise") {
|
||||||
|
rootDir = filepath.Join(rootDir, "..", "grafana")
|
||||||
|
dir, err = filepath.Abs(rootDir)
|
||||||
|
require.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
exists, err := fs.Exists(filepath.Join(dir, "public", "views"))
|
exists, err := fs.Exists(filepath.Join(dir, "public", "views"))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user