Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce python APIv2 test net dependency #23538

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ bindings_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('pkg/bindings/test/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: &build
Expand Down Expand Up @@ -500,7 +500,7 @@ docker-py_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/python/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand All @@ -527,7 +527,7 @@ unit_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('**/*_test.go') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand Down Expand Up @@ -557,8 +557,8 @@ apiv2_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/apiv2/**') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/apiv2/**', 'test/python/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
gce_instance: *standardvm
Expand Down Expand Up @@ -589,7 +589,7 @@ compose_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/compose/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand Down Expand Up @@ -621,7 +621,7 @@ local_integration_test_task: &local_integration_test_task
only_if: &only_if_int_test >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/e2e/**', 'test/utils/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand Down Expand Up @@ -715,7 +715,7 @@ podman_machine_task:
only_if: &only_if_machine_test >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('cmd/podman/machine/**', 'pkg/machine/**', '**/*machine*.go')
depends_on: *build
ec2_instance:
Expand Down Expand Up @@ -838,7 +838,7 @@ local_system_test_task: &local_system_test_task
only_if: &only_if_system_test >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/system/**') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand Down Expand Up @@ -930,7 +930,7 @@ farm_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/farm/**', 'test/system/*.bash') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand All @@ -954,7 +954,7 @@ buildah_bud_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('**/*build*.go', 'test/buildah-bud/**')
depends_on: *build
env:
Expand Down Expand Up @@ -982,7 +982,7 @@ upgrade_test_task:
only_if: >-
$CIRRUS_PR == '' ||
$CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') ||
changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf', 'hack/**', 'version/rawversion/*') ||
changesInclude('test/upgrade/**', 'test/system/*.bash') ||
(changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))
depends_on: *build
Expand Down
5 changes: 4 additions & 1 deletion contrib/cirrus/cirrus_yaml_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def test_depends(self):

def test_only_if(self):
"""2024-07 PR#23174: ugly but necessary duplication in only_if conditions. Prevent typos or unwanted changes."""
beginning = "$CIRRUS_PR == '' || $CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' || changesInclude('.cirrus.yml', 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'hack/**', 'version/rawversion/*') || "
# N/B: This giant string is white space sensitive, take care when updating/modifying
beginning = ("$CIRRUS_PR == '' || $CIRRUS_CHANGE_TITLE =~ '.*CI:ALL.*' || changesInclude('.cirrus.yml',"
" 'Makefile', 'contrib/cirrus/**', 'vendor/**', 'test/tools/**', 'test/registries*.conf',"
" 'hack/**', 'version/rawversion/*') || ")
real_source_changes = " || (changesInclude('**/*.go', '**/*.c', '**/*.h') && !changesIncludeOnly('test/**', 'pkg/machine/e2e/**'))"

for task_name in self.ALL_TASK_NAMES:
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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you feel like it below there is a bunch of CNI references that are not used at all anymore and could be dropped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, ya I was scratching my head on that. Maybe it's best done as a followup PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, I found some other cni references as well so if I find some free time I might get around to nuke that stuff finally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, thanks. I started on #23552 but it can't move forward until this merges (b/c of changesInclude() updates). I have no close attachment to that PR if you have a mind to take on this effort, otherwise I'll continue as best I can after this merges.

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

Expand Down