Skip to content

Commit

Permalink
fix testing pkg for domino pieces in gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
vinicvaz committed Oct 16, 2023
1 parent 699ae0a commit 4f77c53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/domino/testing/http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import time
import docker
from domino.logger import get_configured_logger
from domino.testing import http_server
from pathlib import Path


class TestingHttpClient:

docker_client = docker.from_env()
DOMINO_HTTP_SERVER_PATH = 'domino/domino_py/src/domino/testing/http_server.py'
DOMINO_INTERNAL_REPOSITORY_FOLDER_PATH = "/home/domino/pieces_repository/"
BASE_HTTP_SERVER_HOST_URL = "http://0.0.0.0:8080"
logger = get_configured_logger("TestingHttpClient")
Expand All @@ -35,9 +36,9 @@ def start_http_server(cls, image: str):
try:
container = cls.docker_client.containers.run(
image=image,
command=f"python {cls.DOMINO_HTTP_SERVER_PATH}",
command=["bash", "-c", "python -c 'from domino.testing import http_server; http_server.run_server()'"],
ports={'8080/tcp': ('0.0.0.0', 8080)},
detach=True
detach=True,
)
container_state = container.attrs.get('State').get('Running')
container_status = container.attrs.get('State').get('Status', None)
Expand Down
5 changes: 2 additions & 3 deletions src/domino/testing/http_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ def run_test():
def health_check():
return {"status": "ok"}


if __name__ == '__main__':
run(app=app, host='0.0.0.0', port=8080)
def run_server():
run(app=app, host='0.0.0.0', port=8080)

0 comments on commit 4f77c53

Please sign in to comment.