Skip to content

Commit

Permalink
fix: Remove docker step from unit test workflow (#2535)
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored Apr 13, 2022
1 parent 695f5dd commit 6f22f22
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: docker-practice/actions-setup-docker@1.0.9
- name: Setup Python
id: setup-python
uses: actions/setup-python@v2
Expand Down
16 changes: 9 additions & 7 deletions sdk/python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,18 @@ class TrinoContainerSingleton:
catalog_dir = current_file.parent.joinpath(
"integration/feature_repos/universal/data_sources/catalog"
)

container = (
DockerContainer("trinodb/trino:376")
.with_volume_mapping(catalog_dir, "/etc/catalog/")
.with_exposed_ports("8080")
)
container = None
is_running = False

@classmethod
def get_singleton(cls):
if not cls.is_running:
cls.container = (
DockerContainer("trinodb/trino:376")
.with_volume_mapping(cls.catalog_dir, "/etc/catalog/")
.with_exposed_ports("8080")
)

cls.container.start()
log_string_to_wait_for = "SERVER STARTED"
wait_for_logs(
Expand All @@ -194,7 +195,8 @@ def get_singleton(cls):

@classmethod
def teardown(cls):
cls.container.stop()
if cls.container:
cls.container.stop()


@pytest.fixture(
Expand Down

0 comments on commit 6f22f22

Please sign in to comment.