Skip to content

Commit

Permalink
Fix Archery unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Apr 2, 2024
1 parent 3bc99c5 commit 2304b1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ permissions:

env:
ARCHERY_DEBUG: 1
ARCHERY_USE_DOCKER_CLI: 1

jobs:

Expand Down
19 changes: 3 additions & 16 deletions dev/archery/archery/docker/tests/test_docker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,19 @@ def test_docker_run_with_custom_command(run, build, pull):

assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True, using_docker=False
"ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
use_cache=True,
use_leaf_cache=True,
using_docker=False,
using_buildx=False
)
run.assert_called_once_with(
"ubuntu-cpp",
command="bash",
env={},
resource_limit=None,
user=None,
using_docker=False,
volumes=(),
)

Expand All @@ -75,22 +72,19 @@ def test_docker_run_options(run, build, pull):
result = CliRunner().invoke(docker, args)
assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True, using_docker=False
"ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
use_cache=True,
use_leaf_cache=True,
using_docker=False,
using_buildx=False
)
run.assert_called_once_with(
"ubuntu-cpp",
command=None,
env={"ARROW_GANDIVA": "OFF", "ARROW_FLIGHT": "ON"},
resource_limit=None,
user="root",
using_docker=False,
volumes=(
"./build:/build",
"./ccache:/ccache:delegated",
Expand Down Expand Up @@ -126,7 +120,6 @@ def test_docker_limit_options(run):
env={"ARROW_GANDIVA": "OFF", "ARROW_FLIGHT": "ON"},
resource_limit="github",
user="root",
using_docker=False,
volumes=(
"./build:/build",
"./ccache:/ccache:delegated",
Expand All @@ -145,7 +138,6 @@ def test_docker_run_without_pulling_or_building(run):
env={},
resource_limit=None,
user=None,
using_docker=False,
volumes=(),
)

Expand All @@ -157,14 +149,12 @@ def test_docker_run_only_pulling_and_building(build, pull):
result = CliRunner().invoke(docker, args)
assert result.exit_code == 0
pull.assert_called_once_with(
"ubuntu-cpp", pull_leaf=True, using_docker=False
"ubuntu-cpp", pull_leaf=True,
)
build.assert_called_once_with(
"ubuntu-cpp",
use_cache=True,
use_leaf_cache=True,
using_docker=False,
using_buildx=False
)


Expand All @@ -187,15 +177,12 @@ def test_docker_run_without_build_cache(run, build):
"ubuntu-cpp",
use_cache=False,
use_leaf_cache=False,
using_docker=False,
using_buildx=False
)
run.assert_called_once_with(
"ubuntu-cpp",
command=None,
env={},
resource_limit=None,
user="me",
using_docker=False,
volumes=(),
)

0 comments on commit 2304b1b

Please sign in to comment.