Harden marketplace listing and debug smoke errors
This commit is contained in:
@@ -1324,6 +1324,30 @@ func TestCoreServiceMarketplacePluginsAreFilteredSafeAndStateful(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoreServiceMarketplaceListSkipsHistoricalInvalidCapabilities(t *testing.T) {
|
||||
svc := newTestCoreService()
|
||||
if _, err := svc.RegisterGamePluginManifest(validPluginManifestRegistration()); err != nil {
|
||||
t.Fatalf("register current manifest: %v", err)
|
||||
}
|
||||
|
||||
legacy := gamePluginFromManifestRegistration(validPluginManifestRegistration())
|
||||
legacy.ID = "game.legacy"
|
||||
legacy.Name = "Legacy Server"
|
||||
legacy.RequiredRunCapabilities = append(legacy.RequiredRunCapabilities, "remote.run.protected.sql", "remote.run.protected.rcon")
|
||||
legacy.RemoteAccess.RunCapabilities = append(legacy.RemoteAccess.RunCapabilities, "remote.run.protected.sql", "remote.run.protected.rcon")
|
||||
if err := svc.store.GamePlugins().Create(legacy); err != nil {
|
||||
t.Fatalf("seed historical plugin: %v", err)
|
||||
}
|
||||
|
||||
listed, err := svc.ListMarketplacePlugins(domain.PluginMarketplaceFilter{})
|
||||
if err != nil {
|
||||
t.Fatalf("list marketplace plugins with historical record: %v", err)
|
||||
}
|
||||
if len(listed) != 1 || listed[0].ID != "game.example" {
|
||||
t.Fatalf("expected only current marketplace plugin, got %+v", listed)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCoreServiceAuthorizesPluginBridgeActions(t *testing.T) {
|
||||
svc := newTestCoreService()
|
||||
if _, err := svc.RegisterGamePluginManifest(validPluginManifestRegistration()); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user