Skip to content

Commit e3f04ca

Browse files
ericdalloeca
andcommitted
Fix plugins unit and integration tests to match config key types and new commands
The resolve-all! unit tests used keyword keys (:install, :my-source) but the function expects string keys matching JSON config normalization. The commands integration test was missing the new plugins and plugin-install entries. 🤖 Generated with [eca](https://eca.dev) Co-Authored-By: eca <noreply@eca.dev>
1 parent 74df8d7 commit e3f04ca

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

integration-test/integration/chat/commands_test.clj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
{:name "doctor" :arguments []}
3333
{:name "repo-map-show" :arguments []}
3434
{:name "prompt-show" :arguments [{:name "optional-prompt"}]}
35-
{:name "subagents" :arguments []}]}
35+
{:name "subagents" :arguments []}
36+
{:name "plugins" :arguments []}
37+
{:name "plugin-install" :arguments [{:name "plugin"}]}]}
3638
resp))))
3739

3840
(testing "We query specific commands"
@@ -45,7 +47,8 @@
4547
{:name "costs" :arguments []}
4648
{:name "compact" :arguments [{:name "additional-input"}]}
4749
{:name "config" :arguments []}
48-
{:name "subagents" :arguments []}]}
50+
{:name "subagents" :arguments []}
51+
{:name "plugins" :arguments []}]}
4952
resp))))
5053

5154
(testing "We send a built-in command"

test/eca/features/plugins_test.clj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
{:mcpServers {"test-mcp" {:type "http"
172172
:url "https://example.com/mcp"}}}))
173173
(let [result (plugins/resolve-all!
174-
{:my-source {:source (str source-dir)}
175-
:install ["my-plugin"]})]
174+
{"my-source" {:source (str source-dir)}
175+
"install" ["my-plugin"]})]
176176
(is (= 1 (count (get-in result [:config-fragment :pluginSkillDirs]))))
177177
(is (match? {:test-mcp {:url "https://example.com/mcp"}}
178178
(get-in result [:config-fragment :mcpServers])))
@@ -186,8 +186,8 @@
186186

187187
(testing "returns empty for empty install"
188188
(let [result (plugins/resolve-all!
189-
{:my-source {:source "/some/path"}
190-
:install []})]
189+
{"my-source" {:source "/some/path"}
190+
"install" []})]
191191
(is (empty? (:agents result)))))
192192

193193
(testing "skips missing plugins gracefully"
@@ -196,8 +196,8 @@
196196
(spit (fs/file source-dir ".eca-plugin" "marketplace.json")
197197
(json/generate-string {:plugins [{:name "exists" :source "./plugins/exists"}]}))
198198
(let [result (plugins/resolve-all!
199-
{:src {:source (str source-dir)}
200-
:install ["does-not-exist"]})]
199+
{"src" {:source (str source-dir)}
200+
"install" ["does-not-exist"]})]
201201
(is (empty? (:agents result))))))
202202
(finally
203203
(fs/delete-tree tmp-dir)))))

0 commit comments

Comments
 (0)