Skip to content

ci: de-duplicate recommended tests in the test bot comment - #871

Open
slickwarren wants to merge 1 commit into
rancher:mainfrom
slickwarren:qa-1771-dedupe-test-recommendations
Open

ci: de-duplicate recommended tests in the test bot comment#871
slickwarren wants to merge 1 commit into
rancher:mainfrom
slickwarren:qa-1771-dedupe-test-recommendations

Conversation

@slickwarren

Copy link
Copy Markdown
Collaborator

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

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
@slickwarren
slickwarren requested a review from a team September 2, 2026 06:18
@slickwarren slickwarren added the team/pit-crew slack notifier for pit crew label Sep 2, 2026
Comment on lines +117 to +119
if [[ -n "${seen_tests[$official_tests]:-}" ]]; then
continue
fi

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.

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)

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

Labels

team/pit-crew slack notifier for pit crew

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants