mirror of
https://github.com/Hopiu/llm.git
synced 2026-03-16 20:50:25 +00:00
Test using test-llm-load-plugins.sh
* Run test-llm-load-plugins.sh, closes #378
This commit is contained in:
parent
ed5a535484
commit
469644c2af
2 changed files with 33 additions and 0 deletions
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
|
@ -41,3 +41,7 @@ jobs:
|
|||
- name: Run ruff
|
||||
run: |
|
||||
ruff .
|
||||
- name: Run test-llm-load-plugins.sh
|
||||
run: |
|
||||
llm install llm-cluster llm-mistral
|
||||
./tests/test-llm-load-plugins.sh
|
||||
|
|
|
|||
29
tests/test-llm-load-plugins.sh
Executable file
29
tests/test-llm-load-plugins.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/bash
|
||||
# This should only run in environments where both
|
||||
# llm-cluster and llm-mistral are installed
|
||||
|
||||
PLUGINS=$(llm plugins)
|
||||
echo "$PLUGINS" | jq 'any(.[]; .name == "llm-mistral")' | \
|
||||
grep -q true || ( \
|
||||
echo "Test failed: llm-mistral not found" && \
|
||||
exit 1 \
|
||||
)
|
||||
# With the LLM_LOAD_PLUGINS we should not see that
|
||||
PLUGINS2=$(LLM_LOAD_PLUGINS=llm-cluster llm plugins)
|
||||
echo "$PLUGINS2" | jq 'any(.[]; .name == "llm-mistral")' | \
|
||||
grep -q false || ( \
|
||||
echo "Test failed: llm-mistral should not have been loaded" && \
|
||||
exit 1 \
|
||||
)
|
||||
echo "$PLUGINS2" | jq 'any(.[]; .name == "llm-cluster")' | \
|
||||
grep -q true || ( \
|
||||
echo "Test llm-cluster should have been loaded" && \
|
||||
exit 1 \
|
||||
)
|
||||
# With LLM_LOAD_PLUGINS='' we should see no plugins
|
||||
PLUGINS3=$(LLM_LOAD_PLUGINS='' llm plugins)
|
||||
echo "$PLUGINS3"| \
|
||||
grep -q '\[\]' || ( \
|
||||
echo "Test failed: plugins should have returned []" && \
|
||||
exit 1 \
|
||||
)
|
||||
Loading…
Reference in a new issue