75 Commits

Author SHA1 Message Date
Paul Gschwendtner
5fd1cb56ab build: update dev-infra and rework windows native testing
As part of go/ng:windows-dev-future, we are changing how our
infrastructure supports Windows build & testing. Clearly:

- we will still support contributors on Windows, and we believe we will
  be improving and streamlining the experience here
- we will continue testing the Angular CLI for our Windows users. We are
  aware of the many Windows users using the `ng` CLI.

What is changing? We are no longer actively working towards a Bazel infrastructure
that supports native Windows building and testing. There are currently
two ways to contribute to Angular on Windows. That is via WSL, or via
e.g. native Windows cmd.exe, with Git Bash on top. We acknowledge that
the latter worked sometimes, but we also realize it very often breaks as
nobody on our team uses, verifies it, and it introduces extra complexity
because Bazel on Windows is quite disconnected from Linux/Mac (e.g. no
sandboxing). Going forward, to improve our team's effectiveness, and
improve our stability guarantees for Windows (and Windows contributors),
we are actively discouraging the use of Git Bash for contributing to
Angular; but instead ask for WSL to be used. I can speak as one of the
few long-term team members that have worked on Windows (without WSL) most
of my time, that WSL is great and the contributing experience is much
smoother and also easier to "guide". It's a positive change because we
won't be suggesting "two ways to contribute on Windows", where in
reality one is very brittle and can break at any time!

---

For testing of the Angular CLI: We will continue to maintain the
capability to cross-compile via Bazel with Windows as the target
platform. This allows us to build the e2e tests for Windows, and run
them natively outside WSL to ensure native Windows `ng` CLI testing!
This is what this change mostly does.

Notably, two things are missing here and will be followed up:

- caching of the e2e tests on Windows is not properly functioning yet.
- caching of the WSL node modules + nvm is not working properly yet.

Other than that, we are seeing very similar timing and results of the
Windows tests, so this change unblocks our `rules_js` migration.
2025-03-03 21:44:50 +01:00
Joey Perrott
33ed6e875e refactor: move builtin module imports to use node: prefix imports 2025-02-14 11:09:23 -08:00
Alan Agius
ea2075ab1a build: update dependency tar to v7 2024-12-02 15:31:39 +01:00
Charles Lyding
9b8baa655b test: use Node.js argument parser for E2E test runner
The `node:util` builtin provides an argument parser that
can be leveraged for the E2E test runner that avoids the
need for additional third-party packages.
2024-07-11 13:17:58 +02:00
Charles Lyding
17e168379e build: additional fixes for tsetse rule compliance
Due to bazel rules_nodejs caching, several additional `JSON.parse` usages were not
caught in the first set of fixes. These have now been addressed. Also,
the `must-use-promises` rule has been patched to match the behavior of the
`@typescript-eslint/no-floating-promises` for consistency.
The bazel option `suppressTsconfigOverrideWarnings` was also removed from the
`tsconfig` as it is a no-op and was previously used for now removed feature.
Test files are currently excluded from the `JSON.parse` rule to avoid large
changes to test code.
2024-06-25 11:17:33 -04:00
Alan Agius
c545f77de0 test: add bun and pnpm subsets
This commit adds PNPM and Bun package managers as subsets. However, Bun tests are currently disabled due to an issue where packages from the local registry are only partially extracted.
2024-06-12 18:32:54 +02:00
Doug Parker
7bf4dd6eaf ci: set CHROME_PATH environment variable to Bazel's Chrome install
This variable is used by Chrome launcher under Web Test Runner to find and execute Chrome.
2024-01-04 13:25:35 -08:00
Alan Agius
e6b377436a feat(@angular-devkit/build-angular): add ssr option in application builder
This commit adds an `ssr` option to the application builder, this can be either a `boolean` or an `object` with an `entryPoint` property.

In the future, server bundles will only be emitted when the ssr option is truthy, as unlike SSR, SSG and AppShell do not require the server bundles to be written to disk.
2023-07-10 12:37:30 -04:00
Alan Agius
b4534111b3 test: convert e2e_runner ignore to array
Previously, the ignore was as a string, but this breaks with the last `fast-glob` update.

See: https://app.circleci.com/pipelines/github/angular/angular-cli/31919/workflows/7d68deac-000e-46ef-80f8-4dc259ef61fa/jobs/428958
2023-07-06 09:36:13 -07:00
Charles Lyding
ee5763dcac refactor(@angular-devkit/build-angular): use fast-glob for file searching support
The file searching within the build system (both Webpack and esbuild) now use the
`fast-glob` package for globbing which provides a small performance improvement.
Since the assets option in particular is within the critical path of the buil pipeline,
the performance benefit from the switch will be most prevalent in asset heavy projects.
As an example, the Angular Material documentation site saw the asset discovery time
reduced by over half with the switch. `fast-glob` is also the package used by Vite
which provides additional benefit by ensuring that the Angular CLI behavior matches
that of the newly integrated Vite development server.
2023-05-31 14:54:13 -04:00
Alan Agius
f30a69f260 test: remove non bazel related setups
This commits removes some of the non Bazel related checks that are no longer required.

This also fixes some issues with `bazel run`
2023-02-13 14:14:13 +00:00
Jason Bedard
fac1e58b73
run e2e tests under bazel (#24338)
* test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel

* fixup! test: run legacy-cli e2e tests via bazel
2023-02-03 07:52:28 +00:00
Alan Agius
2589df0be1 Revert "test: run legacy-cli e2e tests via bazel"
This reverts commit 794e33ae72c15a628f308260020bc4da608c4996.
2022-11-28 15:25:48 +00:00
Jason Bedard
794e33ae72 test: run legacy-cli e2e tests via bazel 2022-11-28 13:39:15 +00:00
Alan Agius
b6897dbb0a feat(@schematics/angular): remove karma.conf.js from newly generated projects
`@angular-devkit/build-angular` now has a built in Karma config. Users can still create their own Karma configuration if they want to override the default configuration.
2022-09-28 17:37:53 +02:00
Jason Bedard
2624d8941f test: run e2e tests on pre-compiled packages
The NPM packages being tested must be pre-compiled and the tar packages specified via --package. This way the real packages such as snapshots, release artifacts or cached packages can be tested. Previously the e2e tests compiled and packaged during test execution.
2022-09-26 12:44:46 +02:00
Jason Bedard
decd4692be test: catch and log all errors include test setup 2022-09-19 16:34:49 -04:00
Alan Agius
6a8511d1f9 test: don't run git clean on test failure
This allows debugging the test failures when running in debug mode.

(cherry picked from commit e8e9df875722d23bbfd11c70ad17c492353976ce)
2022-09-09 17:51:11 +02:00
Jason Bedard
2ef2d543b1 test: remove ci specific logic 2022-08-31 16:27:18 -04:00
Jason Bedard
187ab7df58 test: add missing yargs config 2022-08-11 11:25:42 -04:00
Jason Bedard
7c6a4000fb test: add shard and test type/name information to test logging 2022-07-28 19:24:02 +02:00
Jason Bedard
2e4925b6d6 test: revert local test project file changes on test completion 2022-07-28 09:42:18 +02:00
Alan Agius
37841d972e ci: filter yarn and npm tests during E2E test setup
This is a trick to force tests that take longer to run to run on different shards when using different package managers.
2022-07-13 11:58:57 -07:00
Jason Bedard
7dd82282bb test: do not depend on a global npm binary 2022-06-24 08:53:15 -04:00
Alan Agius
2c95ea7415 test: couple of clean ups in e2e tests
Split tests and remove disabled tests
2022-06-14 19:46:08 +02:00
Charles Lyding
4c3a956c1a test: assert catch clause variable type before usage in E2E tests
Prepares the E2E tests for the eventual change of enabling the
TypeScript `useUnknownInCatchVariables` option. This option provides additional
code safety by ensuring that the catch clause variable is the proper type before
attempting to access its properties. Similar changes will be needed in the other
packages in the repository prior to enabling `useUnknownInCatchVariables`.
2022-06-14 11:28:21 +02:00
Jason Bedard
581602e8e7 test: use random port for ng serve e2e tests 2022-06-10 09:41:28 -04:00
Alan Agius
b764ecb1fa test: minor clean up of runSteps logic
Remove redundant vars and imports
2022-06-08 12:08:34 -04:00
Jason Bedard
9c26e2850c test: run tests in isolated subprocess 2022-06-07 11:38:58 -04:00
Jason Bedard
a6faf972ec test: separate test vs test setup execution 2022-06-07 11:38:58 -04:00
Jason Bedard
c74bb5652c test: extract test runner method 2022-06-07 11:38:58 -04:00
Jason Bedard
59a1502272 build: fix typescript compilation errors 2022-06-06 15:38:01 -04:00
Jason Bedard
7ce0982a14 test: keep npm servers alive while in debug state 2022-06-02 13:03:23 -07:00
Jason Bedard
22af652083 test: do not depend on runtime resolution of @angular-devkit/core 2022-05-19 18:31:10 -07:00
Jason Bedard
aa30bb156d test: use random ports for local verdaccio npm servers 2022-05-11 09:12:11 -07:00
Paul Gschwendtner
156f15e47f build: cleanup references to old master branch
Cleans up all referneces to the old `master` branch.
2022-05-04 09:55:54 -07:00
Charles Lyding
ef23b39dd8 ci: add initial E2E test subset for experimental esbuild builder
The basic suite of E2E tests are now run against the newly introduced experimental esbuild-based builder (`browser-esbuild`).
Several tests are currently ignored based on the current feature set of the builder.
2022-04-22 20:45:54 -04:00
Alan Agius
d270258dcd build: update dependency glob to v8 2022-04-14 16:50:08 +02:00
Charles Lyding
d144caa5f2 test: use yargs-parser in E2E test suite runner
The `minimist` package that was previously used is no longer a dependency of the project
and was only working due to package hoisting.
2022-04-13 12:08:44 -07:00
Alan Agius
99bd478b67 test(@angular/cli): improve environment variables clean up during E2E's 2021-07-21 14:45:07 +02:00
Alan Agius
c1eddbdc98 fix(@angular/cli): handle YARN_ environment variables during ng update and ng add
With this change we handle yarn specific environment variables during `ng update` and `ng add`. This is a follow up of #21297
2021-07-21 14:45:07 +02:00
Alan Agius
5d15e5de07 test(@angular/cli): add ng add and ng update E2E tests for secure repositories
With this change we add E2E tests to validate that `ng add` and `ng update` work with secure NPM registries.

This is a follow up of #21140 which addressed several issues with secure registries.
2021-06-18 11:18:25 +01:00
Charles Lyding
b3d7080147 build: enable esModuleInterop TypeScript option
The `esModuleInterop` option is recommended to be enable by TypeScript and corrects several assumptions TypeScript would otherwise make when importing CommonJS files.
This option change helps ensure compatibility as packages move towards ESM.
Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
2021-06-13 11:45:55 -04:00
Alan Agius
5cf9a08dc7 refactor(@angular-devkit/build-angular): remove deprecated i18n options from server and browser builder
BREAKING CHANGE:

Removal of deprecated browser and server command options.
- `i18nFile`,  use `locales` object in the project metadata instead.
- `i18nFormat`, No longer needed as the format will be determined automatically.
- `i18nLocale`, use `localize` option instead.
2021-04-03 14:45:58 +02:00
Alan Agius
1fcc120b16 test(@angular/cli): remove E2E tests which are not used 2021-03-31 12:21:47 -06:00
Alan Agius
fd2dbb37ca test(@angular-devkit/build-angular): clean up tests from ViewEngine code 2021-03-31 10:04:23 -06:00
Charles Lyding
32a0173346 test(@angular/cli): centralize E2E test registry configuration
E2E test registry configuration to ensure that package managers use the test registry during tests is now moved out of the tests and into the setup phase.
2021-02-26 11:15:47 -05:00
Charles Lyding
33ad5e87aa test(@angular/cli): support running E2E tests with yarn
With this change, the E2E test suite can be run using yarn as the package manager instead of npm by using the `--yarn` command line option.
2020-10-15 14:36:37 +02:00
Alan Agius
622d08447d refactor: use ansi-colors instead of removed terminal utils 2020-09-10 20:19:33 +02:00
Charles
862b28f844 fix(@angular-devkit/build-angular): allow localization with development server (#16053)
* fix(@angular-devkit/build-angular): allow localization with development server

* test: ensure i18n application E2E tests are executed
2019-11-08 07:56:05 -08:00