Skip to content

Commit

Permalink
final review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
njvrzm committed Nov 15, 2024
1 parent fc6155c commit 47dbaf6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions backend/datasource/instance_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"

Expand Down
21 changes: 6 additions & 15 deletions backend/datasource/instance_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ func TestInstanceProvider(t *testing.T) {
proxy.PluginSecureSocksProxyClientKeyContents: "This should work",
})
key, err := ip.GetKey(context.Background(), backend.PluginContext{
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{
ID: 5,
JSONData: []byte(`{"enableSecureSocksProxy": true}`),
},
GrafanaConfig: cfg,
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{ID: 5},
GrafanaConfig: cfg,
})
require.NoError(t, err)
require.Equal(t, "5##work", key)
Expand All @@ -54,11 +51,8 @@ func TestInstanceProvider(t *testing.T) {
proxy.PluginSecureSocksProxyClientKeyContents: "",
})
key, err := ip.GetKey(context.Background(), backend.PluginContext{
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{
ID: 6,
JSONData: []byte(`{"enableSecureSocksProxy": true}`),
},
GrafanaConfig: cfg,
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{ID: 6},
GrafanaConfig: cfg,
})
require.NoError(t, err)
require.Equal(t, "6##", key)
Expand All @@ -69,11 +63,8 @@ func TestInstanceProvider(t *testing.T) {
proxy.PluginSecureSocksProxyClientKeyContents: "doh",
})
key, err := ip.GetKey(context.Background(), backend.PluginContext{
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{
ID: 7,
JSONData: []byte(`{"enableSecureSocksProxy": true}`),
},
GrafanaConfig: cfg,
DataSourceInstanceSettings: &backend.DataSourceInstanceSettings{ID: 7},
GrafanaConfig: cfg,
})
require.NoError(t, err)
require.Equal(t, "7##doh", key)
Expand Down

0 comments on commit 47dbaf6

Please sign in to comment.