Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(@angular/build): reverts the test output location to its original #31184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Bjeaurn wants to merge 1 commit into angular:main
base: main
Choose a base branch
Loading
from Bjeaurn:fix-#30713-build-karma-test-out-artifacts

Conversation

Copy link

@Bjeaurn Bjeaurn commented Sep 11, 2025

Closes #30713

Reverts the test output location to its original and removes unique UUID folders. This reverts it back to .angular/cache/test-out/ and does not append the uuid() to the folder. In the future this could be made optional and perhaps we could introduce a output override for the test options.

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

The default (migrated) @angular/build:karma package would output test artifacts into dist/test-out/<uuid>, which would quickly build up folders and make it confusing as test results usually aren't a distributable.

Issue Number: #30713

What is the new behavior?

The default output directory has been reverted to .angular/cache/test-out. Comments have been put in place to prepare the idea to extend it to later allow for custom output directories. It was not clarified if Google itself are depending on this and might require this, so if this is the case let's quickly revisit it and see how we can expand the current solution.

Does this PR introduce a breaking change?

  • Yes
  • No

Although I'm not certain if it "breaks". The new @angular/build:karma seemed to have changed the default output and that was not considered a breaking change it seems? I have marked it as a breaking change for now.

Other information

Copy link

google-cla bot commented Sep 11, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link
Author

Bjeaurn commented Sep 11, 2025

Ahh I had the @angular/cli repository for so long, it's still on my old work email... I'll take a look at if I can fix that and repush the commit, or create a new one...

Copy link
Contributor

jkrems commented Sep 11, 2025

You should be able to use --reset-author on git amend to use your new author info IIRC.

Bjeaurn reacted with thumbs up emoji

@Bjeaurn Bjeaurn force-pushed the fix-#30713-build-karma-test-out-artifacts branch from 68f622a to ae99687 Compare September 11, 2025 16:59
@jkrems jkrems requested a review from clydin September 11, 2025 17:06
@Bjeaurn Bjeaurn force-pushed the fix-#30713-build-karma-test-out-artifacts branch from ae99687 to 602a31f Compare September 11, 2025 17:16
Copy link
Member

clydin commented Sep 11, 2025

The test output files were previously kept in memory when using Karma with Webpack.
As of v21, the Vitest runner will use in-memory files via the unit-test system.

When using the test runners that do still write to disk, the unique identifiers are critical for concurrent test runs.
For v20, an option to address the linked issue may be to implement automatic cleanup similar to what was previously in the Vitest runner: b554bd7

Copy link
Author

Bjeaurn commented Sep 11, 2025

The test output files were previously kept in memory when using Karma with Webpack. As of v21, the Vitest runner will use in-memory files via the unit-test system.

When using the test runners that do still write to disk, the unique identifiers are critical for concurrent test runs. For v20, an option to address the linked issue may be to implement automatic cleanup similar to what was previously in the Vitest runner: b554bd7

Good point! I think for the main one (karma), this was already in there (but did very little in the previous iteration of course, UUIDs are supposed to be unique) over here:

fs.rm(outputPath, { recursive: true, force: true }),

For web-test-runner:

fs.rm(testDir, { recursive: true, force: true }),

It seems that for Jest this is either sorted differently or is currently not being handled, so that might an improvement to make?

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

@clydin clydin Awaiting requested review from clydin

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

@angular/build:karma builder leaves test-out artifacts in the dist directory

AltStyle によって変換されたページ (->オリジナル) /