Skip to content

Commit

Permalink
Merge pull request #350 from digitalocean/fix-docker-check
Browse files Browse the repository at this point in the history
Move dependency binary checks
  • Loading branch information
Zach Moody authored Apr 5, 2021
2 parents 7e16662 + bca0372 commit 6016d97
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def git_toplevel():
str: The path of the top level directory of the current git repo.
"""
try:
subp.check_call(["which", "git"])
except subp.CalledProcessError:
pytest.skip(msg="git executable was not found on the host")
return (
subp.check_output(["git", "rev-parse", "--show-toplevel"])
.decode("utf-8")
Expand All @@ -73,6 +77,10 @@ def netbox_docker_repo_dirpaths(pytestconfig, git_toplevel):
]
}
"""
try:
subp.check_call(["which", "docker"])
except subp.CalledProcessError:
pytest.skip(msg="docker executable was not found on the host")
netbox_versions_by_repo_dirpaths = {}
for netbox_version in pytestconfig.option.netbox_versions:
repo_version_tag = get_netbox_docker_version_tag(netbox_version=netbox_version)
Expand Down Expand Up @@ -196,11 +204,6 @@ def docker_compose_file(pytestconfig, netbox_docker_repo_dirpaths):
clean_netbox_docker_tmpfiles()
clean_docker_objects()

try:
subp.check_call(["which", "docker"])
except subp.CalledProcessError:
pytest.skip(msg="docker executable was not found on the host")

compose_files = []

for (
Expand Down

0 comments on commit 6016d97

Please sign in to comment.