Skip to content

build: replace uniq with sort -u to deduplicate directories in CI workflows - #13933

Merged
kgryte merged 1 commit into
developfrom
philipp/fix-duplicate-tests
Aug 5, 2026
Merged

build: replace uniq with sort -u to deduplicate directories in CI workflows#13933
kgryte merged 1 commit into
developfrom
philipp/fix-duplicate-tests

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Aug 5, 2026

Copy link
Copy Markdown
Member

Resolves stdlib-js/metr-issue-tracker#1113.

Description

What is the purpose of this pull request?

This pull request:

  • Replaces uniq with sort -u in all CI workflow YAML files and their companion shell scripts to properly deduplicate directory lists.
  • Adds a deduplication step after merging changed directories with dependent directories in the affected tests script.

The uniq command only removes adjacent duplicates, so when git diff output produces the same parent directory in non-adjacent positions (e.g., files in root interleaved with subdirectory files), duplicate directory entries survive. This causes test files, benchmarks, and coverage runs to execute multiple times for the same package. For example, in this run, every test file for @stdlib/complex/float32/base/div ran twice.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was written primarily by Claude Code under my direction. Claude identified the root cause by analyzing the workflow scripts and a failing CI run, and authored the uniqsort -u replacements.


@stdlib-js/reviewers

… workflows

The `uniq` command only removes adjacent duplicates, so when
`git diff` output produces the same parent directory in
non-adjacent positions (e.g., files in root interleaved with
subdirectory files), duplicate directory entries survive.

This causes test files, benchmarks, and coverage runs to
execute multiple times for the same package.

Replace `uniq` with `sort -u` in all affected workflow YAML
files and their companion shell scripts. Additionally, add a
deduplication step after merging changed directories with
dependent directories in the affected tests script.

Closes: stdlib-js/metr-issue-tracker#1113

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Planeshifter
Planeshifter requested a review from a team August 5, 2026 04:38
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 5, 2026
@stdlib-js stdlib-js deleted a comment from stdlib-bot Aug 5, 2026
@Planeshifter
Planeshifter requested a review from kgryte August 5, 2026 04:42
@kgryte kgryte added CI Issue or pull request specific to continuous integration environments. and removed Needs Review A pull request which needs code review. labels Aug 5, 2026
@kgryte
kgryte merged commit e7c2c09 into develop Aug 5, 2026
57 of 58 checks passed
@kgryte
kgryte deleted the philipp/fix-duplicate-tests branch August 5, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Issue or pull request specific to continuous integration environments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent tests from running twice in run_affected_tests workflow

3 participants