Skip to content

Update ansible test splitter with indirect node count targets#192

Open
brahmanim wants to merge 3 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 3 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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Update the default values to Optional[str] = None

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Add a condition for adding indirect node count targets only to the updated collection.

@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

@brahmanim brahmanim force-pushed the ACA-5142_sync_splitter_gha_vs_zuul branch from 44f20ea to 2a09d8d Compare April 13, 2026 06:52
@brahmanim
Copy link
Copy Markdown
Author

Hi @abikouo, I will perform my changes to the cloud-content-ci-automation.
Do you think we should merge these PR changes also here on the Ansible Network GitHub Actions, or should I close this PR?

@brahmanim brahmanim requested a review from abikouo April 13, 2026 06:58
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