Skip to content

Update ansible test splitter with indirect node count targets#192

Open
brahmanim wants to merge 2 commits intoansible-network:mainfrom
brahmanim:ACA-5142_sync_splitter_gha_vs_zuul
Open

Update ansible test splitter with indirect node count targets#192
brahmanim wants to merge 2 commits intoansible-network:mainfrom
brahmanim:ACA-5142_sync_splitter_gha_vs_zuul

Conversation

@brahmanim
Copy link
Copy Markdown

This PR introduces a new ability to trigger indirect node count targets by ansible_test_splitter based on the following logic:

This action reads elements to test from the extensions\audit directory and corresponding tests from the tests/integration/targets directory. Here are more details on the relationship between extensions\audit and integration test targets:

  • The test target name should have a prefix node_query_ or define the indirect_node_count line in the aliases file, when the event_query.yml file changes.

This PR also fixes a pre-commit issue: .github/actions/ansible_test_splitter/list_changed_targets.py:63:4: R0912: Too many branches (14/12) (too-many-branches)

self._my_test_plan.append(t)

def add_targets_to_plan_from_aliases_or_prefix_name(
self, alias_line: str = "", prefix_name: str = ""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
self, alias_line: str = "", prefix_name: str = ""
self, alias_line: Optional[str] = None, prefix_name: Optional[str] = None

If you set "" as default value, the expression t.name.startswith(prefix_name) will always be true when using the default value.

continue
# Add the target to the plan if either the name starts with `prefix_name` or
# The aliases file contains the line `alias_line`
if t.is_alias_of(alias_line) or t.name.startswith(prefix_name):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
if t.is_alias_of(alias_line) or t.name.startswith(prefix_name):
if (alias_line and t.is_alias_of(alias_line)) or (prefix_name and t.name.startswith(prefix_name)):

Comment on lines +121 to +123
if whc.extensions_audit_event_query():
for collection in collections:
collection.add_indirect_node_count_targets_to_plan()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This code line is not true. In case of cross-collection testing (which is the case for amazon.aws with community.aws), here we are triggering all the indirect node count targets for all collections when the file is updated in one of the impacted collections.

@abikouo
Copy link
Copy Markdown
Contributor

abikouo commented Apr 1, 2026

@brahmanim You will need to perform your changes into the cloud-content-ci-automation once the following PR is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants