-
Notifications
You must be signed in to change notification settings - Fork 41
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
8 changed files
with
231 additions
and
154 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
*** Settings *** | ||
Library OperatingSystem | ||
Library tlm_lib.py | ||
|
||
|
||
*** Variables *** | ||
${help} tlm help | ||
${version} tlm version | ||
${config} tlm config | ||
${suggest} tlm suggest 'list all files in cwd' | ||
${explain} tlm explain 'ls -all' | ||
|
||
|
||
*** Keywords *** | ||
Run Command | ||
[Arguments] ${command} | ||
${rc} ${output}= Run and Return RC and Output ${command} | ||
Log Return Code: ${rc}${\n}Output:${\n}${output} | ||
|
||
RETURN ${rc} ${output} | ||
|
||
Run Help | ||
${rc} ${output}= Run Command ${help} | ||
RETURN ${rc} ${output} | ||
|
||
Run Version | ||
${rc} ${output}= Run Command ${version} | ||
RETURN ${rc} ${output} | ||
|
||
Run Suggestion | ||
${rc} ${output}= Run Command ${suggest} | ||
RETURN ${rc} ${output} | ||
|
||
Run Explain | ||
${rc} ${output}= Run Command ${explain} | ||
RETURN ${rc} ${output} | ||
|
||
Set Config | ||
[Arguments] ${key} ${value} | ||
Log ${config} set ${key} ${value} | ||
${rc} ${output}= Run Command ${config} set ${key} ${value} | ||
RETURN ${rc} ${output} | ||
|
||
Get Config | ||
[Arguments] ${key} | ||
Log ${config} get ${key} | ||
${rc} ${output}= Run Command ${config} get ${key} | ||
RETURN ${rc} ${output} | ||
|
||
Remove Config File | ||
Remove File ~/.tlm.yaml |
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,157 @@ | ||
*** Settings *** | ||
Library Collections | ||
Resource tlm.resource | ||
Suite Setup Log Variables | ||
|
||
*** Variables *** | ||
${OLLAMA_ENABLED} ${TRUE} | ||
|
||
|
||
*** Test Cases *** | ||
help | ||
tlm help | ||
|
||
version | ||
tlm version | ||
|
||
config | ||
[Setup] Remove Config File | ||
|
||
# Shell | ||
tlm config set shell invalid (negative) | ||
@{shells}= Create List bash powershell auto zsh | ||
FOR ${value} IN @{shells} | ||
tlm config set shell ${value} (positive) | ||
tlm config get shell (positive) ${value} # Check if the value is set | ||
END | ||
|
||
# Ollama Host | ||
tlm config set llm.host invalid-ollama-url (negative) | ||
tlm config set llm.host http://ollama:8080 (positive) | ||
|
||
@{prefs}= Create List stable balanced creative | ||
# Explain Preference | ||
tlm config set llm.explain invalid-pref (negative) | ||
FOR ${value} IN @{prefs} | ||
tlm config set llm.explain ${value} (positive) | ||
tlm config get llm.explain (positive) ${value} # Check if the value is set | ||
END | ||
|
||
# Suggest Preference | ||
tlm config set llm.suggest invalid-pref (negative) | ||
FOR ${value} IN @{prefs} | ||
tlm config set llm.suggest ${value} (positive) | ||
tlm config get llm.suggest (positive) ${value} # Check if the value is set | ||
END | ||
[Teardown] Remove Config File | ||
|
||
deploy (p) | ||
[Tags] deploy requires=ollama | ||
tlm deploy (positive) | ||
|
||
deploy (n) | ||
[Tags] deploy | ||
tlm deploy (negative) | ||
|
||
suggest (p) | ||
[Tags] suggest requires=ollama | ||
tlm suggest 'list all hidden files in cwd' (positive) | ||
|
||
suggest (n) | ||
[Tags] suggest | ||
tlm suggest 'list all hidden files in cwd' (negative) | ||
|
||
explain (p) | ||
[Tags] explain requires=ollama | ||
tlm explain 'ls -all' (positive) | ||
|
||
explain (n) | ||
[Tags] explain | ||
tlm explain 'ls -all' (negative) | ||
|
||
|
||
*** Keywords *** | ||
# ------ Config ------ | ||
|
||
tlm config set ${key} ${value} (positive) | ||
${rc} ${output}= Set Config ${key} ${value} | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} ${key} = ${value} | ||
Should Contain ${output} (ok) | ||
Should Not Contain ${output} (err) | ||
|
||
tlm config set ${key} ${value} (negative) | ||
${rc} ${output}= Set Config ${key} ${value} | ||
Should Not Be Equal As Integers ${rc} 0 | ||
|
||
tlm config get ${key} (positive) | ||
[Arguments] ${value} | ||
${rc} ${output}= Get Config ${key} | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} ${key} = ${value} | ||
|
||
# ------ Version & Help ------ | ||
|
||
tlm help | ||
${rc} ${output}= Run Help | ||
Should Be Equal As Integers ${rc} 0 | ||
Should Contain ${output} NAME: | ||
Should Contain ${output} USAGE: | ||
Should Contain ${output} VERSION: | ||
Should Contain ${output} COMMANDS: | ||
|
||
tlm version | ||
${rc} ${output}= Run Version | ||
Should Be Equal As Integers ${rc} 0 | ||
Version Should Be Correct ${output} | ||
|
||
# ------ Deploy -------- | ||
|
||
tlm deploy (positive) | ||
[Tags] requires=ollama | ||
${rc} ${output}= Run Command tlm deploy | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
|
||
tlm deploy (negative) | ||
${rc} ${output}= Run Command tlm deploy | ||
|
||
Should Be Equal As Integers ${rc} 255 | ||
Should Contain ${output} (err) | ||
Should Contain | ||
... ${output} | ||
... Ollama connection failed. Please check your Ollama if it's running or configured correctly. | ||
|
||
# ------ Suggest -------- | ||
|
||
tlm suggest '${prompt}' (positive) | ||
${rc} ${output}= Run Command tlm suggest '${prompt}' | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
|
||
tlm suggest '${prompt}' (negative) | ||
${rc} ${output}= Run Command tlm suggest '${prompt}' | ||
|
||
Should Be Equal As Integers ${rc} 255 | ||
Should Contain ${output} (err) | ||
Should Contain | ||
... ${output} | ||
... Ollama connection failed. Please check your Ollama if it's running or configured correctly. | ||
|
||
# ------ Explain -------- | ||
|
||
tlm explain '${prompt}' (positive) | ||
${rc} ${output}= Run Command tlm explain '${prompt}' | ||
|
||
Should Be Equal As Integers ${rc} 0 | ||
|
||
tlm explain '${prompt}' (negative) | ||
${rc} ${output}= Run Command tlm explain '${prompt}' | ||
|
||
Should Be Equal As Integers ${rc} 255 | ||
Should Contain ${output} (err) | ||
Should Contain | ||
... ${output} | ||
... Ollama connection failed. Please check your Ollama if it's running or configured correctly. |
Oops, something went wrong.