ci: de-duplicate recommended tests in the test bot comment - #871
Open
slickwarren wants to merge 1 commit into
Open
ci: de-duplicate recommended tests in the test bot comment#871slickwarren wants to merge 1 commit into
slickwarren wants to merge 1 commit into
Conversation
check-changed-tests.sh appends a suite/test entry once per matching diff line, and the same suite can be picked up both by the "modified test" pass and by the "uses modified code" pass. The bot's PR comment then lists the same test several times. De-duplicate (order preserving) while building the comment body, and drop blank lines produced by greps that matched nothing. Behaviour is otherwise unchanged: the count gate still suppresses the comment when the only line is the section separator. Refs rancher/qa-tasks#1771
floatingman
requested review from
floatingman,
hamistao,
khushboo-rancher and
lscalabrini01
September 2, 2026 18:38
floatingman
approved these changes
Sep 2, 2026
Comment on lines
+117
to
+119
| if [[ -n "${seen_tests[$official_tests]:-}" ]]; then | ||
| continue | ||
| fi |
Contributor
There was a problem hiding this comment.
Global dedup spans the "above / below" separator line inside diff.used-anywhere. If every "uses modified code" entry duplicates a "directly modified" entry, the posted comment now ends with "TestSuites below use modified code from this PR." followed by nothing. Harmless (tests are still recommended once), but if you want to preserve section semantics, reset the map when the line matches the separator (or skip lines containing "TestSuites above" from dedup consideration)
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.
check-changed-tests.sh appends a suite/test entry once per matching diff line, and the same suite can be picked up both by the "modified test" pass and by the "uses modified code" pass. The bot's PR comment then lists the same test several times.
De-duplicate (order preserving) while building the comment body, and drop blank lines produced by greps that matched nothing. Behaviour is otherwise unchanged: the count gate still suppresses the comment when the only line is the section separator.
Refs rancher/qa-tasks#1771