-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
231 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
*** Settings *** | ||
Library Collections | ||
Library OperatingSystem | ||
Resource ../tlm.resource | ||
|
||
Suite Setup Run Command tlm config set llm.model ${model} | ||
Suite Teardown Run Command tlm config set llm.model ${model} | ||
|
||
Test Tags command=ask | ||
|
||
Name tlm ask | ||
|
||
|
||
*** Variables *** | ||
${model} qwen2.5-coder:3b | ||
|
||
|
||
*** Test Cases *** | ||
tlm ask <command> | ||
${rc} ${output}= Run Command tlm ask "Why the sky is blue? Name the concept." | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} Rayleigh scatte | ||
|
||
${rc} ${output}= Run Command tlm a "Why the sky is blue? Name the concept." | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} Rayleigh scattering | ||
|
||
tlm ask --context=<context> --include=<patterns> <command> | ||
${rc} ${output}= Run Command tlm ask --context=. --include=**/*.robot "explain provided context" | ||
${expected_file_list}= Create List tests/ask.robot tests/suggest.robot tests/help.robot | ||
|
||
Verify Ask Command Output With Context | ||
... ${rc} | ||
... ${output} | ||
... ${expected_file_list} | ||
|
||
tlm ask --context=<context> --exclude=<patterns> <command> | ||
${rc} ${output}= Run Command tlm ask --context=. --exclude=**/*.robot "explain provided context" | ||
${expected_file_list}= Create List tlm.robot tlm.resource tlm_lib.py requirements.txt | ||
Verify Ask Command Output With Context | ||
... ${rc} | ||
... ${output} | ||
... ${expected_file_list} | ||
|
||
tlm ask (no ollama) | ||
[Tags] no-ollama | ||
# Test that the command fails when OLLAMA_HOST is not set | ||
Remove Environment Variable OLLAMA_HOST | ||
${rc} ${output}= Run Command tlm ask "What is the meaning of life?" | ||
Should Not Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} (err) | ||
Should Contain | ||
... ${output} | ||
... OLLAMA_HOST environment variable is not set | ||
|
||
# Test the command fails when OLLAMA_HOST is set but not reachable | ||
Set Environment Variable OLLAMA_HOST http://localhost:11434 | ||
${rc} ${output}= Run Command tlm ask "What is the meaning of life?" | ||
|
||
Should Not Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} (err) | ||
Should Contain | ||
... ${output} | ||
... Ollama connection failed. Please check your Ollama if it's running or configured correctly. | ||
|
||
tlm ask (non-exist model) | ||
${model}= Set Variable non-exist-model:1b | ||
Run Command tlm config set llm.model ${model} | ||
|
||
${rc} ${output}= Run Command tlm ask 'What is the meaning of life?' | ||
Should Not Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} model "${model}" not found, try pulling it first | ||
|
||
|
||
*** Keywords *** | ||
Verify Ask Command Output With Context | ||
[Arguments] ${rc} ${output} ${expected_file_list} | ||
|
||
Should Be Equal As Numbers ${rc} 0 | ||
|
||
FOR ${file} IN @{expected_file_list} | ||
Should Contain ${output} ${file} | ||
END | ||
|
||
Should Contain ${output} Context Summary: | ||
Should Contain ${output} Total Files: | ||
Should Contain ${output} Total Chars: | ||
Should Contain ${output} Total Tokens: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
*** Settings *** | ||
Library Collections | ||
Resource ../tlm.resource | ||
|
||
Name tlm help | ||
|
||
|
||
*** Test Cases *** | ||
tlm help | ||
[Tags] command=help | ||
${rc} ${output}= Run Command tlm help | ||
Verify Help Command Output ${rc} ${output} | ||
|
||
|
||
*** Keywords *** | ||
Verify Help Command Output | ||
[Arguments] ${rc} ${output} | ||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} NAME: | ||
Should Contain ${output} USAGE: | ||
|
||
Should Contain ${output} VERSION: | ||
|
||
Should Contain ${output} COMMANDS: | ||
Should Contain ${output} ask, a Asks a question | ||
Should Contain ${output} suggest, s Suggests a command. | ||
Should Contain ${output} explain, e Explains a command. | ||
Should Contain ${output} config, c Configures language model, style and shell | ||
Should Contain ${output} version, v Prints tlm version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
*** Settings *** | ||
Resource ../tlm.resource | ||
|
||
Suite Setup Run Command tlm config set llm.model ${model} | ||
|
||
Test Tags command=suggest | ||
|
||
Name tlm suggest | ||
|
||
|
||
*** Variables *** | ||
${model} qwen2.5-coder:1.5b | ||
|
||
|
||
*** Test Cases *** | ||
tlm suggest <prompt> | ||
${output}= Run Suggestion And Verify Output tlm suggest "list all files" | ||
Should Contain ${output} ${model} is thinking... | ||
Should Contain ${output} ls | ||
|
||
Should Contain ${output} Execute | ||
Should Contain ${output} Explain | ||
Should Contain ${output} Cancel | ||
|
||
tlm s <prompt> | ||
${output}= Run Suggestion And Verify Output tlm s "list all files" | ||
Should Contain ${output} ${model} is thinking... | ||
Should Contain ${output} ls | ||
|
||
Should Contain ${output} Execute | ||
Should Contain ${output} Explain | ||
Should Contain ${output} Cancel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*** Settings *** | ||
Library Collections | ||
Resource ../tlm.resource | ||
|
||
Name tlm version | ||
|
||
|
||
*** Test Cases *** | ||
tlm version | ||
${rc} ${output}= Run Version | ||
Should Be Equal As Integers ${rc} 0 | ||
Version Should Be Correct ${output} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.