Skip to content

Commit

Permalink
Reduce python APIv2 test net dependency
Browse files Browse the repository at this point in the history
Previously these tests pulled some test images from quay, opening them up
to networking-flake induced failures.  As has already been done for
other tests, update to utilize the locally running registry server.

Also: Add `test/python/**` into the apiv2 task conditions as referenced
by the `Makefile` `localapiv2-python` target.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Aug 8, 2024
1 parent bf091ab commit 7936809
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ apiv2_test_task:
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/apiv2/**') ||
changesInclude('test/apiv2/**', 'test/python/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
gce_instance: *standardvm
Expand Down
18 changes: 14 additions & 4 deletions test/python/docker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,27 @@ def __init__(self):
os.environ["CONTAINERS_REGISTRIES_CONF"] = os.path.join(
self.anchor_directory, "registry.conf"
)
conf = """unqualified-search-registries = ["docker.io", "quay.io"]

[[registry]]
location="localhost:5000"
insecure=true
# Entry verified by compat/test_system.py
reg_conf_sfx = """
[[registry.mirror]]
location = "mirror.localhost:5000"
"""

# Assume developer-mode testing by default
reg_conf_source_path="./test/registries.conf"

# When operating in a CI environment, use the local registry server.
# Ref: https://github.com/containers/automation_images/pull/357
# https://github.com/containers/podman/pull/22726
if os.getenv("CI_USE_REGISTRY_CACHE"):
reg_conf_source_path = "./test/registries-cached.conf"

with open(os.path.join(reg_conf_source_path)) as file:
conf = file.read() + reg_conf_sfx

with open(os.environ["CONTAINERS_REGISTRIES_CONF"], "w") as file:
file.write(conf)

Expand Down

0 comments on commit 7936809

Please sign in to comment.