diff --git a/plugins/host_artwork_test.go b/plugins/host_artwork_test.go index f37909c14..d47a2c65b 100644 --- a/plugins/host_artwork_test.go +++ b/plugins/host_artwork_test.go @@ -29,9 +29,9 @@ var _ = Describe("ArtworkService", Ordered, func() { tmpDir, err = os.MkdirTemp("", "artwork-test-*") Expect(err).ToNot(HaveOccurred()) - // Copy the fake-artwork plugin - srcPath := filepath.Join(testdataDir, "fake-artwork.wasm") - destPath := filepath.Join(tmpDir, "fake-artwork.wasm") + // Copy the test-artwork plugin + srcPath := filepath.Join(testdataDir, "test-artwork.wasm") + destPath := filepath.Join(tmpDir, "test-artwork.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -64,7 +64,7 @@ var _ = Describe("ArtworkService", Ordered, func() { Describe("Plugin Loading", func() { It("should load plugin with artwork permission", func() { manager.mu.RLock() - p, ok := manager.plugins["fake-artwork"] + p, ok := manager.plugins["test-artwork"] manager.mu.RUnlock() Expect(ok).To(BeTrue()) Expect(p.manifest.Permissions).ToNot(BeNil()) @@ -85,7 +85,7 @@ var _ = Describe("ArtworkService", Ordered, func() { callTestArtwork := func(ctx context.Context, artworkType, id string, size int32) (string, error) { manager.mu.RLock() - p := manager.plugins["fake-artwork"] + p := manager.plugins["test-artwork"] manager.mu.RUnlock() instance, err := p.instance() diff --git a/plugins/host_cache_test.go b/plugins/host_cache_test.go index 8bded1922..37d5218c0 100644 --- a/plugins/host_cache_test.go +++ b/plugins/host_cache_test.go @@ -323,9 +323,9 @@ var _ = Describe("CacheService Integration", Ordered, func() { tmpDir, err = os.MkdirTemp("", "cache-test-*") Expect(err).ToNot(HaveOccurred()) - // Copy the fake_cache_plugin - srcPath := filepath.Join(testdataDir, "fake_cache_plugin.wasm") - destPath := filepath.Join(tmpDir, "fake_cache_plugin.wasm") + // Copy the test-cache-plugin + srcPath := filepath.Join(testdataDir, "test-cache-plugin.wasm") + destPath := filepath.Join(tmpDir, "test-cache-plugin.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -354,7 +354,7 @@ var _ = Describe("CacheService Integration", Ordered, func() { Describe("Plugin Loading", func() { It("should load plugin with cache permission", func() { manager.mu.RLock() - p, ok := manager.plugins["fake_cache_plugin"] + p, ok := manager.plugins["test-cache-plugin"] manager.mu.RUnlock() Expect(ok).To(BeTrue()) Expect(p.manifest.Permissions).ToNot(BeNil()) @@ -383,7 +383,7 @@ var _ = Describe("CacheService Integration", Ordered, func() { callTestCache := func(ctx context.Context, input testCacheInput) (*testCacheOutput, error) { manager.mu.RLock() - p := manager.plugins["fake_cache_plugin"] + p := manager.plugins["test-cache-plugin"] manager.mu.RUnlock() instance, err := p.instance() diff --git a/plugins/host_scheduler_test.go b/plugins/host_scheduler_test.go index 1cce3a214..3f11519e2 100644 --- a/plugins/host_scheduler_test.go +++ b/plugins/host_scheduler_test.go @@ -31,9 +31,9 @@ var _ = Describe("SchedulerService", Ordered, func() { tmpDir, err = os.MkdirTemp("", "scheduler-test-*") Expect(err).ToNot(HaveOccurred()) - // Copy the fake-scheduler plugin - srcPath := filepath.Join(testdataDir, "fake-scheduler.wasm") - destPath := filepath.Join(tmpDir, "fake-scheduler.wasm") + // Copy the test-scheduler plugin + srcPath := filepath.Join(testdataDir, "test-scheduler.wasm") + destPath := filepath.Join(tmpDir, "test-scheduler.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -62,7 +62,7 @@ var _ = Describe("SchedulerService", Ordered, func() { Expect(err).ToNot(HaveOccurred()) // Get scheduler service from plugin's closers and wrap it for testing - service := findSchedulerService(manager, "fake-scheduler") + service := findSchedulerService(manager, "test-scheduler") Expect(service).ToNot(BeNil()) testService = &testableSchedulerService{schedulerServiceImpl: service} testService.scheduler = mockSched @@ -83,11 +83,11 @@ var _ = Describe("SchedulerService", Ordered, func() { Describe("Plugin Loading", func() { It("should detect scheduler capability", func() { names := manager.PluginNames(string(CapabilityScheduler)) - Expect(names).To(ContainElement("fake-scheduler")) + Expect(names).To(ContainElement("test-scheduler")) }) It("should register scheduler service for plugin", func() { - service := findSchedulerService(manager, "fake-scheduler") + service := findSchedulerService(manager, "test-scheduler") Expect(service).ToNot(BeNil()) }) }) @@ -241,7 +241,7 @@ var _ = Describe("SchedulerService", Ordered, func() { // Get the plugin manager.mu.RLock() - plugin, ok := manager.plugins["fake-scheduler"] + plugin, ok := manager.plugins["test-scheduler"] manager.mu.RUnlock() Expect(ok).To(BeTrue()) @@ -278,10 +278,10 @@ var _ = Describe("SchedulerService", Ordered, func() { Expect(mockSched.GetCallbackCount()).To(Equal(1)) // Only recurring task uses scheduler Expect(mockTimers.GetTimerCount()).To(Equal(1)) // Only one-time task uses timer - err = manager.UnloadPlugin("fake-scheduler") + err = manager.UnloadPlugin("test-scheduler") Expect(err).ToNot(HaveOccurred()) - Expect(findSchedulerService(manager, "fake-scheduler")).To(BeNil()) + Expect(findSchedulerService(manager, "test-scheduler")).To(BeNil()) Expect(mockSched.GetCallbackCount()).To(Equal(0)) // Recurring task removed }) }) diff --git a/plugins/host_subsonicapi_test.go b/plugins/host_subsonicapi_test.go index 26ecabfc9..34f10c2a0 100644 --- a/plugins/host_subsonicapi_test.go +++ b/plugins/host_subsonicapi_test.go @@ -31,8 +31,8 @@ var _ = Describe("SubsonicAPI Host Function", Ordered, func() { Expect(err).ToNot(HaveOccurred()) // Copy test plugin to temp dir - srcPath := filepath.Join(testdataDir, "fake-subsonicapi-plugin.wasm") - destPath := filepath.Join(tmpDir, "fake-subsonicapi-plugin.wasm") + srcPath := filepath.Join(testdataDir, "test-subsonicapi-plugin.wasm") + destPath := filepath.Join(tmpDir, "test-subsonicapi-plugin.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -82,7 +82,7 @@ var _ = Describe("SubsonicAPI Host Function", Ordered, func() { Describe("Plugin Loading", func() { It("loads the plugin with SubsonicAPI permission", func() { manager.mu.RLock() - plugin := manager.plugins["fake-subsonicapi-plugin"] + plugin := manager.plugins["test-subsonicapi-plugin"] manager.mu.RUnlock() Expect(plugin).ToNot(BeNil()) @@ -90,11 +90,11 @@ var _ = Describe("SubsonicAPI Host Function", Ordered, func() { It("has the correct manifest", func() { manager.mu.RLock() - plugin := manager.plugins["fake-subsonicapi-plugin"] + plugin := manager.plugins["test-subsonicapi-plugin"] manager.mu.RUnlock() Expect(plugin).ToNot(BeNil()) - Expect(plugin.manifest.Name).To(Equal("Fake SubsonicAPI Plugin")) + Expect(plugin.manifest.Name).To(Equal("Test SubsonicAPI Plugin")) Expect(plugin.manifest.Permissions.Subsonicapi).ToNot(BeNil()) }) }) @@ -104,7 +104,7 @@ var _ = Describe("SubsonicAPI Host Function", Ordered, func() { BeforeEach(func() { manager.mu.RLock() - plugin = manager.plugins["fake-subsonicapi-plugin"] + plugin = manager.plugins["test-subsonicapi-plugin"] manager.mu.RUnlock() Expect(plugin).ToNot(BeNil()) }) @@ -139,7 +139,7 @@ var _ = Describe("SubsonicAPI Host Function", Ordered, func() { // Verify the parameters were added Expect(router.lastRequest).ToNot(BeNil()) query := router.lastRequest.URL.Query() - Expect(query.Get("c")).To(Equal("fake-subsonicapi-plugin")) + Expect(query.Get("c")).To(Equal("test-subsonicapi-plugin")) Expect(query.Get("f")).To(Equal("json")) Expect(query.Get("v")).To(Equal("1.16.1")) Expect(query.Get("type")).To(Equal("newest")) diff --git a/plugins/host_websocket_test.go b/plugins/host_websocket_test.go index 5763fc556..0021f4600 100644 --- a/plugins/host_websocket_test.go +++ b/plugins/host_websocket_test.go @@ -32,9 +32,9 @@ var _ = Describe("WebSocketService", Ordered, func() { tmpDir, err = os.MkdirTemp("", "websocket-test-*") Expect(err).ToNot(HaveOccurred()) - // Copy the fake-websocket plugin - srcPath := filepath.Join(testdataDir, "fake-websocket.wasm") - destPath := filepath.Join(tmpDir, "fake-websocket.wasm") + // Copy the test-websocket plugin + srcPath := filepath.Join(testdataDir, "test-websocket.wasm") + destPath := filepath.Join(tmpDir, "test-websocket.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -55,7 +55,7 @@ var _ = Describe("WebSocketService", Ordered, func() { Expect(err).ToNot(HaveOccurred()) // Get WebSocket service from plugin's closers and wrap it for testing - service := findWebSocketService(manager, "fake-websocket") + service := findWebSocketService(manager, "test-websocket") Expect(service).ToNot(BeNil()) testService = &testableWebSocketService{webSocketServiceImpl: service} @@ -73,11 +73,11 @@ var _ = Describe("WebSocketService", Ordered, func() { Describe("Plugin Loading", func() { It("should detect WebSocket capability", func() { names := manager.PluginNames(string(CapabilityWebSocket)) - Expect(names).To(ContainElement("fake-websocket")) + Expect(names).To(ContainElement("test-websocket")) }) It("should register WebSocket service for plugin", func() { - service := findWebSocketService(manager, "fake-websocket") + service := findWebSocketService(manager, "test-websocket") Expect(service).ToNot(BeNil()) }) }) @@ -98,7 +98,7 @@ var _ = Describe("WebSocketService", Ordered, func() { }) It("should allow hosts matching wildcard patterns", func() { - // fake-websocket manifest allows *.example.com + // test-websocket manifest allows *.example.com // The pattern *.example.com matches any host ending with .example.com ctx := context.Background() allowed := testService.isHostAllowed("api.example.com") @@ -115,7 +115,7 @@ var _ = Describe("WebSocketService", Ordered, func() { }) It("should allow exact host matches", func() { - // fake-websocket manifest allows echo.websocket.org + // test-websocket manifest allows echo.websocket.org allowed := testService.isHostAllowed("echo.websocket.org") Expect(allowed).To(BeTrue()) @@ -125,7 +125,7 @@ var _ = Describe("WebSocketService", Ordered, func() { It("should strip port before checking host", func() { // Implementation strips port before matching against patterns - // fake-websocket manifest has "localhost:*" which matches "localhost" + // test-websocket manifest has "localhost:*" which matches "localhost" // after port stripping // Note: The port wildcard pattern isn't actually implemented, but // since port is stripped, "localhost:*" is compared against "localhost" diff --git a/plugins/manager_test.go b/plugins/manager_test.go index d0aae0936..78b9e214e 100644 --- a/plugins/manager_test.go +++ b/plugins/manager_test.go @@ -17,16 +17,16 @@ var _ = Describe("Manager", Ordered, func() { // Ensure plugin is loaded at the start (might have been unloaded by previous tests) BeforeAll(func() { ctx = GinkgoT().Context() - if _, ok := testManager.plugins["fake-metadata-agent"]; !ok { - err := testManager.LoadPlugin("fake-metadata-agent") + if _, ok := testManager.plugins["test-metadata-agent"]; !ok { + err := testManager.LoadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) } }) // Ensure plugin is restored after all tests in this block AfterAll(func() { - if _, ok := testManager.plugins["fake-metadata-agent"]; !ok { - _ = testManager.LoadPlugin("fake-metadata-agent") + if _, ok := testManager.plugins["test-metadata-agent"]; !ok { + _ = testManager.LoadPlugin("test-metadata-agent") } }) @@ -34,7 +34,7 @@ var _ = Describe("Manager", Ordered, func() { It("auto-loads plugins from folder on Start", func() { // Plugin is already loaded by testManager.Start() via discoverPlugins names := testManager.PluginNames(string(CapabilityMetadataAgent)) - Expect(names).To(ContainElement("fake-metadata-agent")) + Expect(names).To(ContainElement("test-metadata-agent")) }) It("returns error when plugin file does not exist", func() { @@ -45,7 +45,7 @@ var _ = Describe("Manager", Ordered, func() { It("returns error when plugin is already loaded", func() { // Plugin was loaded on Start, try to load again - err := testManager.LoadPlugin("fake-metadata-agent") + err := testManager.LoadPlugin("test-metadata-agent") Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("already loaded")) }) @@ -69,20 +69,20 @@ var _ = Describe("Manager", Ordered, func() { Describe("UnloadPlugin", func() { It("removes a loaded plugin", func() { // Plugin is already loaded from Start - err := testManager.UnloadPlugin("fake-metadata-agent") + err := testManager.UnloadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) names := testManager.PluginNames(string(CapabilityMetadataAgent)) - Expect(names).ToNot(ContainElement("fake-metadata-agent")) + Expect(names).ToNot(ContainElement("test-metadata-agent")) }) It("can reload after unload", func() { // Reload the plugin we just unloaded - err := testManager.LoadPlugin("fake-metadata-agent") + err := testManager.LoadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) names := testManager.PluginNames(string(CapabilityMetadataAgent)) - Expect(names).To(ContainElement("fake-metadata-agent")) + Expect(names).To(ContainElement("test-metadata-agent")) }) It("returns error when plugin not found", func() { @@ -94,11 +94,11 @@ var _ = Describe("Manager", Ordered, func() { Describe("ReloadPlugin", func() { It("unloads and reloads a plugin", func() { - err := testManager.ReloadPlugin("fake-metadata-agent") + err := testManager.ReloadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) names := testManager.PluginNames(string(CapabilityMetadataAgent)) - Expect(names).To(ContainElement("fake-metadata-agent")) + Expect(names).To(ContainElement("test-metadata-agent")) }) It("returns error when plugin not found", func() { @@ -111,9 +111,9 @@ var _ = Describe("Manager", Ordered, func() { Describe("GetPluginInfo", func() { It("returns information about all loaded plugins", func() { info := testManager.GetPluginInfo() - Expect(info).To(HaveKey("fake-metadata-agent")) - Expect(info["fake-metadata-agent"].Name).To(Equal("Test Plugin")) - Expect(info["fake-metadata-agent"].Version).To(Equal("1.0.0")) + Expect(info).To(HaveKey("test-metadata-agent")) + Expect(info["test-metadata-agent"].Name).To(Equal("Test Plugin")) + Expect(info["test-metadata-agent"].Version).To(Equal("1.0.0")) }) }) @@ -129,7 +129,7 @@ var _ = Describe("Manager", Ordered, func() { for i := range concurrency { go func(i int) { defer g.Done() - a, ok := testManager.LoadMediaAgent("fake-metadata-agent") + a, ok := testManager.LoadMediaAgent("test-metadata-agent") Expect(ok).To(BeTrue()) agent := a.(agents.ArtistBiographyRetriever) bio, err := agent.GetArtistBiography(ctx, fmt.Sprintf("artist-%d", i), fmt.Sprintf("Artist %d", i), "") diff --git a/plugins/metadata_agent_test.go b/plugins/metadata_agent_test.go index 2f72bc234..546661d98 100644 --- a/plugins/metadata_agent_test.go +++ b/plugins/metadata_agent_test.go @@ -16,13 +16,13 @@ var _ = Describe("MetadataAgent", Ordered, func() { ctx = GinkgoT().Context() // Load the agent via shared manager var ok bool - agent, ok = testManager.LoadMediaAgent("fake-metadata-agent") + agent, ok = testManager.LoadMediaAgent("test-metadata-agent") Expect(ok).To(BeTrue()) }) Describe("AgentName", func() { It("returns the plugin name", func() { - Expect(agent.AgentName()).To(Equal("fake-metadata-agent")) + Expect(agent.AgentName()).To(Equal("test-metadata-agent")) }) }) @@ -127,14 +127,14 @@ var _ = Describe("MetadataAgent error handling", Ordered, func() { // Create manager with error injection config errorManager, _ = createTestManager(map[string]map[string]string{ - "fake-metadata-agent": { + "test-metadata-agent": { "error": "simulated plugin error", }, }) // Load the agent var ok bool - errorAgent, ok = errorManager.LoadMediaAgent("fake-metadata-agent") + errorAgent, ok = errorManager.LoadMediaAgent("test-metadata-agent") Expect(ok).To(BeTrue()) }) diff --git a/plugins/plugins_suite_test.go b/plugins/plugins_suite_test.go index 983a3a443..52c8d1391 100644 --- a/plugins/plugins_suite_test.go +++ b/plugins/plugins_suite_test.go @@ -21,7 +21,7 @@ const testDataDir = "plugins/testdata" // Shared test state initialized in BeforeSuite var ( - testdataDir string // Path to testdata folder with fake-metadata-agent.wasm + testdataDir string // Path to testdata folder with test-metadata-agent.wasm tmpPluginsDir string // Temp directory for plugin tests that modify files testManager *Manager ) @@ -46,10 +46,10 @@ func buildTestPlugins(t *testing.T, path string) { } // createTestManager creates a new plugin Manager with the given plugin config. -// It creates a temp directory, copies the fake-metadata-agent plugin, and starts the manager. +// It creates a temp directory, copies the test-metadata-agent plugin, and starts the manager. // Returns the manager, temp directory path, and a cleanup function. func createTestManager(pluginConfig map[string]map[string]string) (*Manager, string) { - return createTestManagerWithPlugins(pluginConfig, "fake-metadata-agent.wasm") + return createTestManagerWithPlugins(pluginConfig, "test-metadata-agent.wasm") } // createTestManagerWithPlugins creates a new plugin Manager with the given plugin config @@ -94,7 +94,7 @@ func createTestManagerWithPlugins(pluginConfig map[string]map[string]string, plu } var _ = BeforeSuite(func() { - // Get testdata directory (where fake-metadata-agent.wasm lives) + // Get testdata directory (where test-metadata-agent.wasm lives) _, currentFile, _, ok := runtime.Caller(0) Expect(ok).To(BeTrue()) testdataDir = filepath.Join(filepath.Dir(currentFile), "testdata") diff --git a/plugins/scrobbler_adapter_test.go b/plugins/scrobbler_adapter_test.go index 6ad7db47a..1713b948f 100644 --- a/plugins/scrobbler_adapter_test.go +++ b/plugins/scrobbler_adapter_test.go @@ -25,11 +25,11 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { // Add user to context for username extraction ctx = request.WithUser(ctx, model.User{ID: "user-1", UserName: "testuser"}) - // Load the scrobbler via a new manager with the fake-scrobbler plugin - scrobblerManager, _ = createTestManagerWithPlugins(nil, "fake-scrobbler.wasm") + // Load the scrobbler via a new manager with the test-scrobbler plugin + scrobblerManager, _ = createTestManagerWithPlugins(nil, "test-scrobbler.wasm") var ok bool - s, ok = scrobblerManager.LoadScrobbler("fake-scrobbler") + s, ok = scrobblerManager.LoadScrobbler("test-scrobbler") Expect(ok).To(BeTrue()) }) @@ -39,7 +39,7 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { }) It("returns false for a plugin without Scrobbler capability", func() { - _, ok := testManager.LoadScrobbler("fake-metadata-agent") + _, ok := testManager.LoadScrobbler("test-metadata-agent") Expect(ok).To(BeFalse()) }) @@ -57,10 +57,10 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { It("returns false when plugin is configured to not authorize", func() { manager, _ := createTestManagerWithPlugins(map[string]map[string]string{ - "fake-scrobbler": {"authorized": "false"}, - }, "fake-scrobbler.wasm") + "test-scrobbler": {"authorized": "false"}, + }, "test-scrobbler.wasm") - sc, ok := manager.LoadScrobbler("fake-scrobbler") + sc, ok := manager.LoadScrobbler("test-scrobbler") Expect(ok).To(BeTrue()) result := sc.IsAuthorized(ctx, "user-1") @@ -87,10 +87,10 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { It("returns error when plugin returns error", func() { manager, _ := createTestManagerWithPlugins(map[string]map[string]string{ - "fake-scrobbler": {"error": "service unavailable", "error_type": "retry_later"}, - }, "fake-scrobbler.wasm") + "test-scrobbler": {"error": "service unavailable", "error_type": "retry_later"}, + }, "test-scrobbler.wasm") - sc, ok := manager.LoadScrobbler("fake-scrobbler") + sc, ok := manager.LoadScrobbler("test-scrobbler") Expect(ok).To(BeTrue()) track := &model.MediaFile{ID: "track-1", Title: "Test Song"} @@ -122,10 +122,10 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { It("returns error when plugin returns not_authorized error", func() { manager, _ := createTestManagerWithPlugins(map[string]map[string]string{ - "fake-scrobbler": {"error": "user not linked", "error_type": "not_authorized"}, - }, "fake-scrobbler.wasm") + "test-scrobbler": {"error": "user not linked", "error_type": "not_authorized"}, + }, "test-scrobbler.wasm") - sc, ok := manager.LoadScrobbler("fake-scrobbler") + sc, ok := manager.LoadScrobbler("test-scrobbler") Expect(ok).To(BeTrue()) scrobble := scrobbler.Scrobble{ @@ -139,10 +139,10 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { It("returns error when plugin returns unrecoverable error", func() { manager, _ := createTestManagerWithPlugins(map[string]map[string]string{ - "fake-scrobbler": {"error": "track rejected", "error_type": "unrecoverable"}, - }, "fake-scrobbler.wasm") + "test-scrobbler": {"error": "track rejected", "error_type": "unrecoverable"}, + }, "test-scrobbler.wasm") - sc, ok := manager.LoadScrobbler("fake-scrobbler") + sc, ok := manager.LoadScrobbler("test-scrobbler") Expect(ok).To(BeTrue()) scrobble := scrobbler.Scrobble{ @@ -158,12 +158,12 @@ var _ = Describe("ScrobblerPlugin", Ordered, func() { Describe("PluginNames", func() { It("returns plugin names with Scrobbler capability", func() { names := scrobblerManager.PluginNames("Scrobbler") - Expect(names).To(ContainElement("fake-scrobbler")) + Expect(names).To(ContainElement("test-scrobbler")) }) It("does not return metadata agent plugins for Scrobbler capability", func() { names := testManager.PluginNames("Scrobbler") - Expect(names).ToNot(ContainElement("fake-metadata-agent")) + Expect(names).ToNot(ContainElement("test-metadata-agent")) }) }) }) diff --git a/plugins/testdata/Makefile b/plugins/testdata/Makefile index ee14054fb..96d330667 100644 --- a/plugins/testdata/Makefile +++ b/plugins/testdata/Makefile @@ -1,4 +1,4 @@ -# Build fake sample plugins used for testing +# Build test plugins used for integration testing # Auto-discover all plugin folders (folders containing go.mod) PLUGINS := $(patsubst %/go.mod,%,$(wildcard */go.mod)) diff --git a/plugins/testdata/fake_cache_plugin/go.mod b/plugins/testdata/fake_cache_plugin/go.mod deleted file mode 100644 index 3663f3f94..000000000 --- a/plugins/testdata/fake_cache_plugin/go.mod +++ /dev/null @@ -1,5 +0,0 @@ -module fake-cache - -go 1.23 - -require github.com/extism/go-pdk v1.1.3 diff --git a/plugins/testdata/fake-artwork/go.mod b/plugins/testdata/test-artwork/go.mod similarity index 71% rename from plugins/testdata/fake-artwork/go.mod rename to plugins/testdata/test-artwork/go.mod index 79b9bb5a7..6fe319d3b 100644 --- a/plugins/testdata/fake-artwork/go.mod +++ b/plugins/testdata/test-artwork/go.mod @@ -1,4 +1,4 @@ -module fake-artwork +module test-artwork go 1.23 diff --git a/plugins/testdata/fake-artwork/go.sum b/plugins/testdata/test-artwork/go.sum similarity index 100% rename from plugins/testdata/fake-artwork/go.sum rename to plugins/testdata/test-artwork/go.sum diff --git a/plugins/testdata/fake-artwork/main.go b/plugins/testdata/test-artwork/main.go similarity index 91% rename from plugins/testdata/fake-artwork/main.go rename to plugins/testdata/test-artwork/main.go index 5ec68bcc8..db3cb1ac5 100644 --- a/plugins/testdata/fake-artwork/main.go +++ b/plugins/testdata/test-artwork/main.go @@ -1,5 +1,5 @@ -// Fake Artwork plugin for Navidrome plugin system integration tests. -// Build with: tinygo build -o ../fake-artwork.wasm -target wasip1 -buildmode=c-shared . +// Test Artwork plugin for Navidrome plugin system integration tests. +// Build with: tinygo build -o ../test-artwork.wasm -target wasip1 -buildmode=c-shared . package main import ( @@ -29,10 +29,10 @@ type ArtworkPermission struct { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake Artwork", + Name: "Test Artwork", Author: "Navidrome Test", Version: "1.0.0", - Description: "A fake artwork plugin for integration testing", + Description: "A test artwork plugin for integration testing", Permissions: &Permissions{ Artwork: &ArtworkPermission{ Reason: "For testing artwork URL generation", diff --git a/plugins/testdata/fake-artwork/nd_host_artwork.go b/plugins/testdata/test-artwork/nd_host_artwork.go similarity index 100% rename from plugins/testdata/fake-artwork/nd_host_artwork.go rename to plugins/testdata/test-artwork/nd_host_artwork.go diff --git a/plugins/testdata/test-cache-plugin/go.mod b/plugins/testdata/test-cache-plugin/go.mod new file mode 100644 index 000000000..06aedd113 --- /dev/null +++ b/plugins/testdata/test-cache-plugin/go.mod @@ -0,0 +1,5 @@ +module test-cache-plugin + +go 1.23 + +require github.com/extism/go-pdk v1.1.3 diff --git a/plugins/testdata/fake-metadata-agent/go.sum b/plugins/testdata/test-cache-plugin/go.sum similarity index 100% rename from plugins/testdata/fake-metadata-agent/go.sum rename to plugins/testdata/test-cache-plugin/go.sum diff --git a/plugins/testdata/fake_cache_plugin/main.go b/plugins/testdata/test-cache-plugin/main.go similarity index 95% rename from plugins/testdata/fake_cache_plugin/main.go rename to plugins/testdata/test-cache-plugin/main.go index 4dc5f1ea4..cb6c873be 100644 --- a/plugins/testdata/fake_cache_plugin/main.go +++ b/plugins/testdata/test-cache-plugin/main.go @@ -1,5 +1,5 @@ -// Fake Cache plugin for Navidrome plugin system integration tests. -// Build with: tinygo build -o ../fake_cache_plugin.wasm -target wasip1 -buildmode=c-shared . +// Test Cache plugin for Navidrome plugin system integration tests. +// Build with: tinygo build -o ../test-cache-plugin.wasm -target wasip1 -buildmode=c-shared . package main import ( @@ -28,10 +28,10 @@ type CachePermission struct { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake Cache Plugin", + Name: "Test Cache Plugin", Author: "Navidrome Test", Version: "1.0.0", - Description: "A fake cache plugin for integration testing", + Description: "A test cache plugin for integration testing", Permissions: &Permissions{ Cache: &CachePermission{ Reason: "For testing cache operations", diff --git a/plugins/testdata/fake_cache_plugin/nd_host_cache.go b/plugins/testdata/test-cache-plugin/nd_host_cache.go similarity index 100% rename from plugins/testdata/fake_cache_plugin/nd_host_cache.go rename to plugins/testdata/test-cache-plugin/nd_host_cache.go diff --git a/plugins/testdata/fake-metadata-agent/go.mod b/plugins/testdata/test-metadata-agent/go.mod similarity index 100% rename from plugins/testdata/fake-metadata-agent/go.mod rename to plugins/testdata/test-metadata-agent/go.mod diff --git a/plugins/testdata/fake-scheduler/go.sum b/plugins/testdata/test-metadata-agent/go.sum similarity index 100% rename from plugins/testdata/fake-scheduler/go.sum rename to plugins/testdata/test-metadata-agent/go.sum diff --git a/plugins/testdata/fake-metadata-agent/main.go b/plugins/testdata/test-metadata-agent/main.go similarity index 100% rename from plugins/testdata/fake-metadata-agent/main.go rename to plugins/testdata/test-metadata-agent/main.go diff --git a/plugins/testdata/fake-scrobbler/go.mod b/plugins/testdata/test-scheduler/go.mod similarity index 69% rename from plugins/testdata/fake-scrobbler/go.mod rename to plugins/testdata/test-scheduler/go.mod index 1b318b1b7..f46d2ed0e 100644 --- a/plugins/testdata/fake-scrobbler/go.mod +++ b/plugins/testdata/test-scheduler/go.mod @@ -1,4 +1,4 @@ -module fake-scrobbler +module test-scheduler go 1.23 diff --git a/plugins/testdata/fake-scrobbler/go.sum b/plugins/testdata/test-scheduler/go.sum similarity index 100% rename from plugins/testdata/fake-scrobbler/go.sum rename to plugins/testdata/test-scheduler/go.sum diff --git a/plugins/testdata/fake-scheduler/main.go b/plugins/testdata/test-scheduler/main.go similarity index 90% rename from plugins/testdata/fake-scheduler/main.go rename to plugins/testdata/test-scheduler/main.go index 0857502b7..43e29f47d 100644 --- a/plugins/testdata/fake-scheduler/main.go +++ b/plugins/testdata/test-scheduler/main.go @@ -1,5 +1,5 @@ -// Fake scheduler plugin for Navidrome plugin system integration tests. -// Build with: tinygo build -o ../fake-scheduler.wasm -target wasip1 -buildmode=c-shared . +// Test scheduler plugin for Navidrome plugin system integration tests. +// Build with: tinygo build -o ../test-scheduler.wasm -target wasip1 -buildmode=c-shared . package main import ( @@ -28,10 +28,10 @@ type SchedulerPermission struct { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake Scheduler", + Name: "Test Scheduler", Author: "Navidrome Test", Version: "1.0.0", - Description: "A fake scheduler plugin for integration testing", + Description: "A test scheduler plugin for integration testing", Permissions: &Permissions{ Scheduler: &SchedulerPermission{ Reason: "For testing scheduler callbacks", diff --git a/plugins/testdata/fake-scheduler/nd_host_scheduler.go b/plugins/testdata/test-scheduler/nd_host_scheduler.go similarity index 100% rename from plugins/testdata/fake-scheduler/nd_host_scheduler.go rename to plugins/testdata/test-scheduler/nd_host_scheduler.go diff --git a/plugins/testdata/fake-scheduler/pdk.gen.go b/plugins/testdata/test-scheduler/pdk.gen.go similarity index 100% rename from plugins/testdata/fake-scheduler/pdk.gen.go rename to plugins/testdata/test-scheduler/pdk.gen.go diff --git a/plugins/testdata/fake-scheduler/go.mod b/plugins/testdata/test-scrobbler/go.mod similarity index 69% rename from plugins/testdata/fake-scheduler/go.mod rename to plugins/testdata/test-scrobbler/go.mod index 80efb3cb9..b61f4d474 100644 --- a/plugins/testdata/fake-scheduler/go.mod +++ b/plugins/testdata/test-scrobbler/go.mod @@ -1,4 +1,4 @@ -module fake-scheduler +module test-scrobbler go 1.23 diff --git a/plugins/testdata/fake-subsonicapi-plugin/go.sum b/plugins/testdata/test-scrobbler/go.sum similarity index 100% rename from plugins/testdata/fake-subsonicapi-plugin/go.sum rename to plugins/testdata/test-scrobbler/go.sum diff --git a/plugins/testdata/fake-scrobbler/main.go b/plugins/testdata/test-scrobbler/main.go similarity index 95% rename from plugins/testdata/fake-scrobbler/main.go rename to plugins/testdata/test-scrobbler/main.go index b80bdfe82..bd5f7de4e 100644 --- a/plugins/testdata/fake-scrobbler/main.go +++ b/plugins/testdata/test-scrobbler/main.go @@ -1,5 +1,5 @@ -// Fake scrobbler plugin for Navidrome plugin system integration tests. -// Build with: tinygo build -o ../fake-scrobbler.wasm -target wasip1 -buildmode=c-shared ./main.go +// Test scrobbler plugin for Navidrome plugin system integration tests. +// Build with: tinygo build -o ../test-scrobbler.wasm -target wasip1 -buildmode=c-shared ./main.go package main import ( @@ -94,10 +94,10 @@ func checkAuthConfig() bool { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake Scrobbler", + Name: "Test Scrobbler", Author: "Navidrome Test", Version: "1.0.0", - Description: "A fake scrobbler plugin for integration testing", + Description: "A test scrobbler plugin for integration testing", } out, err := json.Marshal(manifest) if err != nil { diff --git a/plugins/testdata/fake-subsonicapi-plugin/go.mod b/plugins/testdata/test-subsonicapi-plugin/go.mod similarity index 61% rename from plugins/testdata/fake-subsonicapi-plugin/go.mod rename to plugins/testdata/test-subsonicapi-plugin/go.mod index db8fa74ed..6b8633c71 100644 --- a/plugins/testdata/fake-subsonicapi-plugin/go.mod +++ b/plugins/testdata/test-subsonicapi-plugin/go.mod @@ -1,4 +1,4 @@ -module fake-subsonicapi-plugin +module test-subsonicapi-plugin go 1.24 diff --git a/plugins/testdata/fake-websocket/go.sum b/plugins/testdata/test-subsonicapi-plugin/go.sum similarity index 100% rename from plugins/testdata/fake-websocket/go.sum rename to plugins/testdata/test-subsonicapi-plugin/go.sum diff --git a/plugins/testdata/fake-subsonicapi-plugin/main.go b/plugins/testdata/test-subsonicapi-plugin/main.go similarity index 94% rename from plugins/testdata/fake-subsonicapi-plugin/main.go rename to plugins/testdata/test-subsonicapi-plugin/main.go index 9fbc5f5fe..c882a1c96 100644 --- a/plugins/testdata/fake-subsonicapi-plugin/main.go +++ b/plugins/testdata/test-subsonicapi-plugin/main.go @@ -1,5 +1,5 @@ // Test plugin for SubsonicAPI host function integration tests. -// Build with: tinygo build -o ../fake-subsonicapi-plugin.wasm -target wasip1 -buildmode=c-shared ./main.go +// Build with: tinygo build -o ../test-subsonicapi-plugin.wasm -target wasip1 -buildmode=c-shared ./main.go package main import ( @@ -29,7 +29,7 @@ type SubsonicAPIPermission struct { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake SubsonicAPI Plugin", + Name: "Test SubsonicAPI Plugin", Author: "Navidrome Test", Version: "1.0.0", Description: "Test plugin for SubsonicAPI host function", diff --git a/plugins/testdata/fake-subsonicapi-plugin/nd_host_subsonicapi.go b/plugins/testdata/test-subsonicapi-plugin/nd_host_subsonicapi.go similarity index 100% rename from plugins/testdata/fake-subsonicapi-plugin/nd_host_subsonicapi.go rename to plugins/testdata/test-subsonicapi-plugin/nd_host_subsonicapi.go diff --git a/plugins/testdata/fake-websocket/go.mod b/plugins/testdata/test-websocket/go.mod similarity index 69% rename from plugins/testdata/fake-websocket/go.mod rename to plugins/testdata/test-websocket/go.mod index e22941de0..b514a079d 100644 --- a/plugins/testdata/fake-websocket/go.mod +++ b/plugins/testdata/test-websocket/go.mod @@ -1,4 +1,4 @@ -module fake-websocket +module test-websocket go 1.23 diff --git a/plugins/testdata/fake_cache_plugin/go.sum b/plugins/testdata/test-websocket/go.sum similarity index 100% rename from plugins/testdata/fake_cache_plugin/go.sum rename to plugins/testdata/test-websocket/go.sum diff --git a/plugins/testdata/fake-websocket/main.go b/plugins/testdata/test-websocket/main.go similarity index 96% rename from plugins/testdata/fake-websocket/main.go rename to plugins/testdata/test-websocket/main.go index 2dc15fae9..7447dc85d 100644 --- a/plugins/testdata/fake-websocket/main.go +++ b/plugins/testdata/test-websocket/main.go @@ -1,5 +1,5 @@ -// Fake WebSocket plugin for Navidrome plugin system integration tests. -// Build with: tinygo build -o ../fake-websocket.wasm -target wasip1 -buildmode=c-shared . +// Test WebSocket plugin for Navidrome plugin system integration tests. +// Build with: tinygo build -o ../test-websocket.wasm -target wasip1 -buildmode=c-shared . package main import ( @@ -29,10 +29,10 @@ type WebSocketPermission struct { //go:wasmexport nd_manifest func ndManifest() int32 { manifest := Manifest{ - Name: "Fake WebSocket", + Name: "Test WebSocket", Author: "Navidrome Test", Version: "1.0.0", - Description: "A fake WebSocket plugin for integration testing", + Description: "A test WebSocket plugin for integration testing", Permissions: &Permissions{ WebSocket: &WebSocketPermission{ Reason: "For testing WebSocket callbacks", diff --git a/plugins/testdata/fake-websocket/nd_host_websocket.go b/plugins/testdata/test-websocket/nd_host_websocket.go similarity index 100% rename from plugins/testdata/fake-websocket/nd_host_websocket.go rename to plugins/testdata/test-websocket/nd_host_websocket.go diff --git a/plugins/watcher_integration_test.go b/plugins/watcher_integration_test.go index aaa52fb1c..c7432198e 100644 --- a/plugins/watcher_integration_test.go +++ b/plugins/watcher_integration_test.go @@ -30,14 +30,14 @@ var _ = Describe("Watcher Integration", Ordered, func() { manager, tmpDir = createTestManager(nil) // Remove the auto-loaded plugin so tests can control loading - _ = manager.UnloadPlugin("fake-metadata-agent") - _ = os.Remove(filepath.Join(tmpDir, "fake-metadata-agent.wasm")) + _ = manager.UnloadPlugin("test-metadata-agent") + _ = os.Remove(filepath.Join(tmpDir, "test-metadata-agent.wasm")) }) // Helper to copy test plugin into the temp folder copyTestPlugin := func() { - srcPath := filepath.Join(testdataDir, "fake-metadata-agent.wasm") - destPath := filepath.Join(tmpDir, "fake-metadata-agent.wasm") + srcPath := filepath.Join(testdataDir, "test-metadata-agent.wasm") + destPath := filepath.Join(tmpDir, "test-metadata-agent.wasm") data, err := os.ReadFile(srcPath) Expect(err).ToNot(HaveOccurred()) err = os.WriteFile(destPath, data, 0600) @@ -49,32 +49,32 @@ var _ = Describe("Watcher Integration", Ordered, func() { AfterEach(func() { // Clean up: unload plugin if loaded, remove copied file - _ = manager.UnloadPlugin("fake-metadata-agent") - _ = os.Remove(filepath.Join(tmpDir, "fake-metadata-agent.wasm")) + _ = manager.UnloadPlugin("test-metadata-agent") + _ = os.Remove(filepath.Join(tmpDir, "test-metadata-agent.wasm")) }) It("loads a plugin on CREATE event", func() { copyTestPlugin() - manager.processPluginEvent("fake-metadata-agent", notify.Create) - Expect(manager.PluginNames(string(CapabilityMetadataAgent))).To(ContainElement("fake-metadata-agent")) + manager.processPluginEvent("test-metadata-agent", notify.Create) + Expect(manager.PluginNames(string(CapabilityMetadataAgent))).To(ContainElement("test-metadata-agent")) }) It("reloads a plugin on WRITE event", func() { copyTestPlugin() - err := manager.LoadPlugin("fake-metadata-agent") + err := manager.LoadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) - manager.processPluginEvent("fake-metadata-agent", notify.Write) - Expect(manager.PluginNames(string(CapabilityMetadataAgent))).To(ContainElement("fake-metadata-agent")) + manager.processPluginEvent("test-metadata-agent", notify.Write) + Expect(manager.PluginNames(string(CapabilityMetadataAgent))).To(ContainElement("test-metadata-agent")) }) It("unloads a plugin on REMOVE event", func() { copyTestPlugin() - err := manager.LoadPlugin("fake-metadata-agent") + err := manager.LoadPlugin("test-metadata-agent") Expect(err).ToNot(HaveOccurred()) - manager.processPluginEvent("fake-metadata-agent", notify.Remove) - Expect(manager.PluginNames(string(CapabilityMetadataAgent))).ToNot(ContainElement("fake-metadata-agent")) + manager.processPluginEvent("test-metadata-agent", notify.Remove) + Expect(manager.PluginNames(string(CapabilityMetadataAgent))).ToNot(ContainElement("test-metadata-agent")) }) })