Plugins: Add /meta and /metas APIs to plugins app (#113775)
* add /meta and /metas APIs * wrapped storage route * format file * fix switch statement lint issue * fix plugininstaller test --------- Co-authored-by: Todd Treece <todd.treece@grafana.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/pluginfakes"
|
||||
@@ -208,7 +209,9 @@ func TestService_Run(t *testing.T) {
|
||||
|
||||
t.Cleanup(func() {
|
||||
s.StopAsync()
|
||||
err := s.AwaitTerminated(context.Background())
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
err := s.AwaitTerminated(ctx)
|
||||
if tt.shouldThrowError {
|
||||
require.ErrorContains(t, err, "Failed to install plugin")
|
||||
return
|
||||
@@ -225,6 +228,8 @@ func TestService_Run(t *testing.T) {
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
<-s.installComplete
|
||||
|
||||
if tt.shouldInstall {
|
||||
expectedInstalled := 0
|
||||
expectedInstalledFromURL := 0
|
||||
@@ -246,7 +251,6 @@ func TestService_Run(t *testing.T) {
|
||||
expectedInstalled++
|
||||
}
|
||||
}
|
||||
<-s.installComplete
|
||||
require.Equal(t, expectedInstalled, installed)
|
||||
require.Equal(t, expectedInstalledFromURL, installedFromURL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user