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

Housekeeping: remove duplicates from success_task #24279

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

edsantiago
Copy link
Member

Accidentally introduced in #21639.

There's probably a way to check for dups in cirrus_yaml_test.py
but my python is too rusty.

Signed-off-by: Ed Santiago santiago@redhat.com

None

@openshift-ci openshift-ci bot added release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Oct 15, 2024
@baude
Copy link
Member

baude commented Oct 15, 2024

LGTM

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@Luap99
Copy link
Member

Luap99 commented Oct 15, 2024

diff --git a/contrib/cirrus/cirrus_yaml_test.py b/contrib/cirrus/cirrus_yaml_test.py
index f127ffbfa2..b19dd111ca 100755
--- a/contrib/cirrus/cirrus_yaml_test.py
+++ b/contrib/cirrus/cirrus_yaml_test.py
@@ -60,6 +60,18 @@ class TestDependsOn(TestCaseBase):
                 msg=('No success aggregation task depends_on "{0}"'.format(task_name))
                 self.assertIn(task_name, success_deps, msg=msg)
 
+    def test_duplicate_depends(self):
+        """Check for duplicate names in depends_on"""
+        for task_name in self.ALL_TASK_NAMES:
+            task = self.CIRRUS_YAML[task_name + '_task']
+            if 'depends_on' in task:
+                depends_on = task['depends_on']
+                seen = set()
+                for x in depends_on:
+                    self.assertNotIn(x,seen, msg=f"depends_on contains duplicated names in task {task_name}")
+                    seen.add(x)
+
+
     def test_only_if(self):
         """2024-07 PR#23174: ugly but necessary duplication in only_if conditions. Prevent typos or unwanted changes."""
         # N/B: This giant string is white space sensitive, take care when updating/modifying

Some quick 5min from me, results in this one main:

FAIL: test_duplicate_depends (__main__.TestDependsOn.test_duplicate_depends)
Check for duplicate names in depends_on
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pholzing/go/src/github.com/containers/podman/./contrib/cirrus/cirrus_yaml_test.py", line 71, in test_duplicate_depends
    self.assertNotIn(x,seen, msg=f"depends_on contains duplicated names in task {task_name}")
AssertionError: 'local_system_test' unexpectedly found in {'rootless_system_test', 'podman_machine_mac', 'rootless_integration_test', 'unit_test', 'podman_machine_windows', 'local_system_test', 'local_system_test_aarch64', 'swagger', 'bindings', 'remote_system_test_aarch64', 'remote_system_test', 'apiv2_test', 'rootless_remote_system_test', 'compose_test', 'local_integration_test', 'container_integration_test', 'podman_machine', 'docker-py_test', 'build_success', 'podman_machine_aarch64', 'win_installer', 'remote_integration_test'} : depends_on contains duplicated names in task success

Accidentally introduced in containers#21639.

Thanks to Paul for the Python code to prevent this from
happening again.

Signed-off-by: Ed Santiago <santiago@redhat.com>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 15, 2024
Copy link
Contributor

openshift-ci bot commented Oct 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit f668fd9 into containers:main Oct 15, 2024
84 of 86 checks passed
@edsantiago edsantiago deleted the dedup-cirrus branch October 15, 2024 17:22
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 14, 2025
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants