Skip to content

Commit

Permalink
fix: e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sangjanai committed Dec 3, 2024
1 parent fb71045 commit a96e5ac
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions engine/e2e-test/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys

### e2e tests are expensive, have to keep engines tests in order
from test_api_engine_list import TestApiEngineList
from test_api_engine import TestApiEngine
from test_api_model import TestApiModel
from test_api_model_import import TestApiModelImport
Expand Down
5 changes: 0 additions & 5 deletions engine/e2e-test/test_api_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ def setup_and_teardown(self):

# Teardown
stop_server()

# engines list
def test_engines_list_api_run_successfully(self):
response = requests.get("http://localhost:3928/engines")
assert response.status_code == 200

# engines get
def test_engines_get_llamacpp_should_be_successful(self):
Expand Down
25 changes: 25 additions & 0 deletions engine/e2e-test/test_api_engine_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import pytest
import requests
from test_runner import start_server, stop_server


class TestApiEngineList:

@pytest.fixture(autouse=True)
def setup_and_teardown(self):
# Setup
# Not sure why but on macOS amd, the first start server timeouts with CI
start_server()
stop_server()
success = start_server()
if not success:
raise Exception("Failed to start server")

yield

# Teardown
stop_server()

def test_engines_list_api_run_successfully(self):
response = requests.get("http://localhost:3928/engines")
assert response.status_code == 200

0 comments on commit a96e5ac

Please sign in to comment.