Skip to content

Migrate more tests to rules_js, specifically @angular/build #29454

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

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

devversion
Copy link
Member

See individual commits

@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Jan 22, 2025
@devversion devversion added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jan 23, 2025
Avoid pnpm auto-installing peer dependencies. We want to be explicit about our versions used
for peer dependencies, avoiding potential mismatches. In addition, it ensures we can continue
to rely on peer dependency placeholders substituted via Bazel.
Migrates the SSR tesst to run natively via `rules_js`. Notably, we still
need the bundling in between as the tests and SSR plain code is not
valid ESM technically; due to lack of extensions.

We'll need to revisit this in the future, or at the very least come up
with a `rules_js`-variant of the `spec_bundle`; but for this is
sufficient and unblocks other packages.
Fully migrates `modules/testing/builders` to `rules_js`, so that it can
resolve modules at runtime using RJS, or executes tests via RJS.
Migrates `@angular/build` tests to native `rules_js`. This involves
wiring up the package in the pnpm workspace, as well as adding some
missing dependencies that previously weren't needed due to less
efficient per-package isolation of transitive deps.

In addition, we need to explicitly specify `ssr` as dev dependency as we
are not auto-installing peer deps, and the dependency is needed for some
server SSR tests.
@devversion devversion marked this pull request as ready for review January 23, 2025 08:51
@@ -19,6 +19,8 @@ ts_project(
],
)

# TODO: Replace this with a `rules_js` variant, or make the SSR package
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what is the problem here, the SSR package should be native ESM compatible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests use the direct .js output, so it's not the bundled FESM. In addition, the test code itself does import files without explicit .mjs or .js extensions; so it's not "valid ESM". Needs future clean-up in general

Copy link
Collaborator

@alan-agius4 alan-agius4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a question.

@alan-agius4 alan-agius4 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 Jan 23, 2025
@devversion devversion added target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Jan 23, 2025
@devversion devversion merged commit 96490cd into angular:main Jan 23, 2025
32 of 33 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants