Update ansible test splitter with indirect node count targets#192
Open
brahmanim wants to merge 2 commits intoansible-network:mainfrom
Open
Update ansible test splitter with indirect node count targets#192brahmanim wants to merge 2 commits intoansible-network:mainfrom
brahmanim wants to merge 2 commits intoansible-network:mainfrom
Conversation
abikouo
requested changes
Apr 1, 2026
| self._my_test_plan.append(t) | ||
|
|
||
| def add_targets_to_plan_from_aliases_or_prefix_name( | ||
| self, alias_line: str = "", prefix_name: str = "" |
Contributor
There was a problem hiding this comment.
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): |
Contributor
There was a problem hiding this comment.
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() |
Contributor
There was a problem hiding this comment.
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.
Contributor
|
@brahmanim You will need to perform your changes into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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\auditdirectory and corresponding tests from thetests/integration/targetsdirectory. Here are more details on the relationship betweenextensions\auditand integration test targets:node_query_or define theindirect_node_countline in thealiasesfile, when theevent_query.ymlfile 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)