Skip to content

Conversation

@clydin
Copy link
Member

@clydin clydin commented Dec 1, 2025

Adds truncation logic to the generateNameFromPath function in the unit test discovery process. This prevents issues with filesystems that have filename length limits.

When a generated test entrypoint name exceeds 128 characters, it is truncated. The truncated name consists of a prefix of the original name, an 8-character SHA256 hash of the full path, and a suffix of the original name, ensuring uniqueness while keeping the name readable.

Unit tests are included to verify the truncation behavior for long filenames.

Closes #31968

Adds truncation logic to the `generateNameFromPath` function in the unit test discovery process. This prevents issues with filesystems that have filename length limits.

When a generated test entrypoint name exceeds 128 characters, it is truncated. The truncated name consists of a prefix of the original name, an 8-character SHA256 hash of the full path, and a suffix of the original name, ensuring uniqueness while keeping the name readable.

Unit tests are included to verify the truncation behavior for long filenames.
@clydin clydin added the target: patch This PR is targeted for the next patch release label Dec 1, 2025
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 1, 2025
@clydin clydin requested a review from alan-agius4 December 1, 2025 15:36
@clydin clydin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 1, 2025
@clydin clydin removed the request for review from alan-agius4 December 1, 2025 16:09
@alan-agius4 alan-agius4 merged commit 63c3e3f into angular:main Dec 1, 2025
38 checks passed
@alan-agius4
Copy link
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the unit-test/long-test-names branch December 1, 2025 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue: ENAMETOOLONG during @angular/build:karma test builds on macOS

3 participants