VSCode: Launch Grafana with Storage server (#88351)

* VSCode: Launch Grafana with Storage server

* Fix module_server_test
This commit is contained in:
Gabriel MABILLE
2024-05-29 10:02:35 +02:00
committed by GitHub
parent 1f90123f35
commit 5eecc01123
5 changed files with 24 additions and 10 deletions
+5 -2
View File
@@ -9,13 +9,16 @@ import (
"github.com/grafana/dskit/services"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestRunInstrumentationService(t *testing.T) {
s, err := NewInstrumentationService(log.New("test-logger"))
cfg := setting.NewCfg()
cfg.HTTPPort = "3001"
s, err := NewInstrumentationService(log.New("test-logger"), cfg)
require.NoError(t, err)
ctx, cancel := context.WithTimeout(context.Background(), 300*time.Second)
@@ -35,7 +38,7 @@ func TestRunInstrumentationService(t *testing.T) {
time.Sleep(100 * time.Millisecond)
client := http.Client{}
res, err := client.Get("http://localhost:3000/metrics")
res, err := client.Get("http://localhost:3001/metrics")
require.NoError(t, err)
assert.Equal(t, 200, res.StatusCode)