MCPcopy Create free account
hub / github.com/apache/arrow / test_compose_run

Function test_compose_run

dev/archery/archery/docker/tests/test_docker.py:426–479  ·  view source on GitHub ↗
(arrow_compose_path)

Source from the content-addressed store, hash-verified

424
425
426def test_compose_run(arrow_compose_path):
427 expected_calls = [
428 format_run("conda-cpp"),
429 ]
430 compose = DockerCompose(arrow_compose_path)
431 with assert_compose_calls(compose, expected_calls):
432 compose.run('conda-cpp')
433
434 expected_calls = [
435 format_run("conda-python")
436 ]
437 expected_env = PartialEnv(PYTHON='3.8')
438 with assert_compose_calls(compose, expected_calls, env=expected_env):
439 compose.run('conda-python')
440
441 compose = DockerCompose(arrow_compose_path, params=dict(PYTHON='3.9'))
442 expected_env = PartialEnv(PYTHON='3.9')
443 with assert_compose_calls(compose, expected_calls, env=expected_env):
444 compose.run('conda-python')
445
446 compose = DockerCompose(arrow_compose_path, params=dict(PYTHON='3.9'))
447 for command in ["bash", "echo 1"]:
448 expected_calls = [
449 format_run(["conda-python", command]),
450 ]
451 expected_env = PartialEnv(PYTHON='3.9')
452 with assert_compose_calls(compose, expected_calls, env=expected_env):
453 compose.run('conda-python', command)
454
455 expected_calls = [
456 (
457 format_run("-e CONTAINER_ENV_VAR_A=a -e CONTAINER_ENV_VAR_B=b "
458 "conda-python")
459 )
460 ]
461 compose = DockerCompose(arrow_compose_path)
462 expected_env = PartialEnv(PYTHON='3.8')
463 with assert_compose_calls(compose, expected_calls, env=expected_env):
464 env = collections.OrderedDict([
465 ("CONTAINER_ENV_VAR_A", "a"),
466 ("CONTAINER_ENV_VAR_B", "b")
467 ])
468 compose.run('conda-python', env=env)
469
470 expected_calls = [
471 (
472 format_run("--volume /host/build:/build --volume "
473 "/host/ccache:/ccache:delegated conda-python")
474 )
475 ]
476 compose = DockerCompose(arrow_compose_path)
477 with assert_compose_calls(compose, expected_calls):
478 volumes = ("/host/build:/build", "/host/ccache:/ccache:delegated")
479 compose.run('conda-python', volumes=volumes)
480
481
482def test_compose_run_with_resource_limits(arrow_compose_path):

Callers

nothing calls this directly

Calls 5

runMethod · 0.95
DockerComposeClass · 0.90
PartialEnvClass · 0.90
format_runFunction · 0.85
assert_compose_callsFunction · 0.85

Tested by

no test coverage detected