Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufcanb committed Feb 9, 2025
1 parent c2c80e9 commit fb6d535
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 deletions.
35 changes: 7 additions & 28 deletions e2e/tlm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ config
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)
Expand All @@ -45,14 +41,6 @@ config
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)
Expand Down Expand Up @@ -99,30 +87,21 @@ tlm help
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.

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 --------

Expand Down
2 changes: 1 addition & 1 deletion e2e/tlm_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@keyword("Version Should Be Correct")
def check_version(version: str):
import re
pattern = r'^tlm\s\d+\.\d+\s\([0-9a-f]+\)\son\s\w+/\w+$'
pattern = r'^tlm\s\d+\.\d+(?:-pre)?\s\([0-9a-f]+\)\son\s\w+/\w+$'
if re.match(pattern, version):
return True
else:
Expand Down

0 comments on commit fb6d535

Please sign in to comment.