@@ -1,7 +1,6 @@
11package skills
22
33import (
4− "context"
54 "os"
65 "path/filepath"
76 "strings"
@@ -216,7 +215,8 @@ func TestSkillValidate(t *testing.T) {
216215}
217216
218217func TestDiscover(t *testing.T) {
219− // Not parallel: shares global broker with other Discover tests.
218+ t.Parallel()
219+
220220 tmpDir := t.TempDir()
221221
222222 // Create valid skill 1.
@@ -248,14 +248,8 @@ description: Name doesn't match directory.
248248---
249249`), 0o644))
250250
251− ctx, cancel := context.WithCancel(context.Background())
252− defer cancel()
253− ch := SubscribeEvents(ctx)
254−
255− skills := Discover([]string{tmpDir})
251+ skills, states := DiscoverWithStates([]string{tmpDir})
256252
257− evt := <-ch
258− states := evt.Payload.States
259253 var normalCount int
260254 var errorCount int
261255 var hasInvalidDir bool
@@ -285,32 +279,20 @@ description: Name doesn't match directory.
285279}
286280
287281func TestDiscoverEmptyDir(t *testing.T) {
288− // Not parallel: shares global broker with other Discover tests.
282+ t.Parallel()
289283
290284 tmpDir := t.TempDir()
291285
292− ctx, cancel := context.WithCancel(context.Background())
293− defer cancel()
294− ch := SubscribeEvents(ctx)
295−
296− skills := Discover([]string{tmpDir})
297−
298− evt := <-ch
299− require.Empty(t, evt.Payload.States)
286+ skills, states := DiscoverWithStates([]string{tmpDir})
287+ require.Empty(t, states)
300288 require.Empty(t, skills)
301289}
302290
303291func TestDiscoverMissingPath(t *testing.T) {
304− // Not parallel: shares global broker with other Discover tests.
305−
306− ctx, cancel := context.WithCancel(context.Background())
307− defer cancel()
308− ch := SubscribeEvents(ctx)
309−
310− skills := Discover([]string{filepath.Join(t.TempDir(), "missing")})
292+ t.Parallel()
311293
312− evt := <-ch
313− require.Empty(t, evt.Payload.States)
294+ skills, states := DiscoverWithStates([]string{filepath.Join(t.TempDir(), "missing")})
295+ require.Empty(t, states)
314296 require.Empty(t, skills)
315297}
316298