Skip to content

Commit

Permalink
Added a function to get slc docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
tomuben committed Jul 16, 2024
1 parent 1ec5989 commit 0cce96c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions exasol/nb_connector/slct_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from collections import namedtuple
from typing import Optional, List

from exasol_integration_test_docker_environment.lib.docker import ContextDockerClient
from git import Repo
from pathlib import Path
from exasol_script_languages_container_tool.lib import api as exaslct_api # type: ignore
Expand Down Expand Up @@ -211,6 +212,13 @@ def append_custom_packages(self, pip_packages: List[PipPackageDefinition]):
for p in pip_packages:
print(f"{p.pkg}|{p.version}", file=f)

@property
def slc_docker_images(self):
with ContextDockerClient() as docker_client:
images = docker_client.images.list(name="exasol/script-language-container")
image_tags = [img.tags[0] for img in images]
return image_tags

def clean_all_images(self):
"""
Deletes all local docker images.
Expand Down
9 changes: 9 additions & 0 deletions test/integration/test_slct_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ def test_export_slc(slct_manager):
assert len(tgz_sum) == 1
assert tgz_sum[0].is_file()

@pytest.mark.dependency(
name="slc_images", depends=["export_slc"]
)
def test_slc_images(slct_manager):
images = slct_manager.slc_docker_images
assert len(images) > 0
for img in images:
assert "exasol/script-language-container" in img


@pytest.mark.dependency(
name="upload_slc", depends=["check_config"]
Expand Down

0 comments on commit 0cce96c

Please sign in to comment.