mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-13 04:52:57 +00:00
Fix container running
This commit is contained in:
@@ -21,15 +21,14 @@ def test_units(container):
|
|||||||
LOGGER.info(f"Not found unit tests for image: {container.image_name}")
|
LOGGER.info(f"Not found unit tests for image: {container.image_name}")
|
||||||
return
|
return
|
||||||
|
|
||||||
command = "sleep infinity"
|
|
||||||
running_container = container.run(
|
|
||||||
volumes={host_data_dir: {"bind": cont_data_dir, "mode": "ro"}},
|
|
||||||
tty=True,
|
|
||||||
command=["start.sh", "bash", "-c", command],
|
|
||||||
)
|
|
||||||
for test_file in os.listdir(host_data_dir):
|
for test_file in os.listdir(host_data_dir):
|
||||||
LOGGER.info(f"Running unit test: {test_file}")
|
LOGGER.info(f"Running unit test: {test_file}")
|
||||||
command = f"python {cont_data_dir}/{test_file}"
|
|
||||||
cmd = running_container.exec_run(command)
|
c = container.run(
|
||||||
assert cmd.exit_code == 0, f"Command {command} failed"
|
tty=True,
|
||||||
LOGGER.debug(cmd.output.decode("utf-8"))
|
command=['start.sh', 'python', f'{cont_data_dir}/{test_file}']
|
||||||
|
)
|
||||||
|
rv = c.wait(timeout=30)
|
||||||
|
assert rv == 0 or rv["StatusCode"] == 0
|
||||||
|
logs = c.logs(stdout=True).decode('utf-8')
|
||||||
|
LOGGER.debug(logs)
|
||||||
|
Reference in New Issue
Block a user