| 54 | @patch.object(DockerCompose, "build") |
| 55 | @patch.object(DockerCompose, "run") |
| 56 | def test_docker_run_options(run, build, pull): |
| 57 | # environment variables and volumes |
| 58 | args = [ |
| 59 | "run", |
| 60 | "-e", |
| 61 | "ARROW_GANDIVA=OFF", |
| 62 | "-e", |
| 63 | "ARROW_FLIGHT=ON", |
| 64 | "--volume", |
| 65 | "./build:/build", |
| 66 | "-v", |
| 67 | "./ccache:/ccache:delegated", |
| 68 | "-u", |
| 69 | "root", |
| 70 | "ubuntu-cpp", |
| 71 | ] |
| 72 | result = CliRunner().invoke(docker, args) |
| 73 | assert result.exit_code == 0 |
| 74 | pull.assert_called_once_with( |
| 75 | "ubuntu-cpp", pull_leaf=True, |
| 76 | ) |
| 77 | build.assert_called_once_with( |
| 78 | "ubuntu-cpp", |
| 79 | use_cache=True, |
| 80 | use_leaf_cache=True, |
| 81 | ) |
| 82 | run.assert_called_once_with( |
| 83 | "ubuntu-cpp", |
| 84 | command=None, |
| 85 | env={"ARROW_GANDIVA": "OFF", "ARROW_FLIGHT": "ON"}, |
| 86 | resource_limit=None, |
| 87 | user="root", |
| 88 | volumes=( |
| 89 | "./build:/build", |
| 90 | "./ccache:/ccache:delegated", |
| 91 | ), |
| 92 | ) |
| 93 | |
| 94 | |
| 95 | @patch.object(DockerCompose, "run") |