-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add install and uninstall e2e testing
- Loading branch information
Showing
6 changed files
with
96 additions
and
15 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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import pytest | ||
from test_api_engine_list import TestApiEngineList | ||
from test_cli_engine_get import TestCliEngineGet | ||
from test_cli_engine_install import TestCliEngineInstall | ||
from test_cli_engine_list import TestCliEngineList | ||
from test_cli_engine_uninstall import TestCliEngineUninstall | ||
|
||
if __name__ == "__main__": | ||
pytest.main([__file__, "-v"]) |
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,30 @@ | ||
import platform | ||
|
||
import pytest | ||
from test_runner import run | ||
|
||
|
||
class TestCliEngineInstall: | ||
|
||
def test_engines_install_llamacpp_should_be_successfully(self): | ||
exit_code, output, error = run( | ||
"Install Engine", ["engines", "install", "cortex.llamacpp"] | ||
) | ||
assert "Download" in output, "Should display downloading message" | ||
assert exit_code == 0, f"Install engine failed with error: {error}" | ||
|
||
@pytest.mark.skipif(platform.system() != "Darwin", reason="macOS-specific test") | ||
def test_engines_install_onnx_on_macos_should_be_failed(self): | ||
exit_code, output, error = run( | ||
"Install Engine", ["engines", "install", "cortex.onnx"] | ||
) | ||
assert "No variant found" in output, "Should display error message" | ||
assert exit_code == 0, f"Install engine failed with error: {error}" | ||
|
||
@pytest.mark.skipif(platform.system() != "Darwin", reason="macOS-specific test") | ||
def test_engines_install_onnx_on_tensorrt_should_be_failed(self): | ||
exit_code, output, error = run( | ||
"Install Engine", ["engines", "install", "cortex.tensorrt-llm"] | ||
) | ||
assert "No variant found" in output, "Should display error message" | ||
assert exit_code == 0, f"Install engine failed with error: {error}" |
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,24 @@ | ||
import pytest | ||
from test_runner import run | ||
|
||
|
||
class TestCliEngineUninstall: | ||
|
||
@pytest.fixture(autouse=True) | ||
def setup_and_teardown(self): | ||
# Setup | ||
# Preinstall llamacpp engine | ||
run("Install Engine", ["engines", "install", "cortex.llamacpp"]) | ||
|
||
yield | ||
|
||
# Teardown | ||
# Clean up, removing installed engine | ||
run("Uninstall Engine", ["engines", "uninsatll", "cortex.llamacpp"]) | ||
|
||
def test_engines_uninstall_llamacpp_should_be_successfully(self): | ||
exit_code, output, error = run( | ||
"Uninstall engine", ["engines", "uninstall", "cortex.llamacpp"] | ||
) | ||
assert "Engine cortex.llamacpp uninstalled successfully!" in output | ||
assert exit_code == 0, f"Install engine failed with error: {error}" |
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