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:
Will Browne
2025-11-24 18:20:11 +00:00
committed by GitHub
parent 335111e783
commit f1dbbcbe00
33 changed files with 4057 additions and 1041 deletions
@@ -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)
}