This commit removes a number of obsolete integration tests and also removes some e2e tests for a few remianing apps, since they are not adding value, but cause extra time to spend on CI.
PR Close#60594
In Bazel, the `CI` environment variable is not set due to its hermetic nature. As a result, caching is enabled by default, which includes Vite pre-bundling. This is unnecessary in CI environments.
In some cases, this leads to errors during CI runs when the Vite build is closed or canceled prematurely, resulting in the following errors:
```
Error: R] The build was canceled
Error: R] Terminating worker thread [plugin angular-vite-optimize-deps]
```
PR Close#57863
This commit also performs lock file maintenance on all integration
tests, fixing some ambigous ESM/CJS dependency graph issues.
e.g.
```
Unknown error: Error [ERR_REQUIRE_ESM]: require() of ES Module /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/string-width/index.js from /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
------------------------------------------
```
Closes#56261.
PR Close#56364
Enables the new `@` block syntax by default by removing the `enabledBlockTypes` flags. There are still some internal flags that allow special use cases to opt out of the block syntax, like during XML parsing and when compiling older libraries (see #51979).
PR Close#51994
Since we updated the devkit dependencies, we need to update
the browserslist DB versions in integration tests to avoid
browser mismatches causing errors like the following:
```
BrowserslistError: [BABEL] /tmp/ng-integration-test-91jP3g/test-sandbox/node_modules/zone.js/fesm2015/zone.js: Unknown version 114 of edge (While processing: "base$0$0")
```
PR Close#50772
Since v15, prod mode is handled by the CLI with the `optimization` flag. We can remove the environement files and `enableProdMode` when the tests use the CLI.
PR Close#49746
- This update is needed to implement the changes in `ng add localize` https://github.com/angular/angular/pull/47569
- Add missing `root` options to all `angular.json`, this is required as otherwise the angular.json validation will fail.
- Remove `require.context` from test.ts integration test, as this is no longer needed.
- Update payloads golden files.
PR Close#47584
Adds support for TypeScript 4.8 and resolves some issues that came up as a result of the update.
Most of the issues came from some changes in TypeScript where the `decorators` and `modifiers` properties were removed from most node types, and were combined into a single `modifiers` array. Since we need to continue supporting TS 4.6 and 4.7 until v15, I ended up creating a new `ngtsc/ts_compatibility` directory to make it easier to reuse the new backwards-compatible code.
PR Close#47038
Fixes that the integration test size trackings stopped working due to
the recent refactorings (switch to the rule from `@angular/dev-infra-private`).
The size-tracking does not integrate very-well into Bazel and needs
a better solution in the future, allowing for RBE and Windows support,
but currently with the new rule/setup/structure the tracking does not
validate sizes because:
* The `dist/*.js` argument to the tracking script got expanded and
messed up the indices. It should be passed as a literal. This now
surfaced because the new rule runs commands in a shell.
* The name for the size goldens were not computed properly because they
were based on `ctx.attr.name`, but given the new structure, the test
targets are always named `test`.
PR Close#44430
Switches the integration tests form Puppeteer/webdriver-manager to the
Bazel-managed Chromium/Chromedriver. This is now possible with the new
integration test rule for which we can consult the
`dev-infra/bazel/browsers` toolchain and setup environment variables.
This has been configured already in a previous commit.
This commit also includes some additional small cleanups necessary for
the new integration test rule:
* The `test.sh` scripts have been renamed as they would conflict with
the `test.sh` scripts generated by the integration test rule.
Previously this was not an issue because tests were declared at a
higher-level. As mentioned though this has other downsides and it is
trivial to rename the file.
* Related to the point above, since tests are now declared witin the
actual test folder (for perf e.g.), `package.json` files setting
`"type": "module"` will accidentally cause the `nodejs_test`-generated
files to be considered ESM. This is not correct and likely needs to be
fixed upstream in `rules_nodejs` where explicit `.cjs` extensions
should be used. This is only happening **once** in the `injectable-def`
test so it is acceptable doing that for now.
PR Close#44238
Sets up the test targets for integration tests with the new rule.
The targets will match the configuration of the previous integration
test setup (through the dictionary in a `bzl` file).
Note: We already add `setup_chromium` based on whether Chromium tests
run as part of this integration test. In a follow-up commit we can then
remove puppeteer and rely on the Bazel-managed version of Chromium.
PR Close#44238
ChromeDriver now supports Apple Silicon ARM processors.
`webdriver-manager` versions 12.1.7 and earlier will, however,
incorrectly download the arm64 ChromeDriver regardless of the
system's architecture. This results in failure to run Protractor tests
on macOS with the error: `spawn Unknown system error -86`
This commit fixes the problem by upgrading `webdriver-manager` to
version 12.1.8, which includes a fix.
See also https://stackoverflow.com/questions/65618558.
PR Close#40756
Upgrade the karma dependency to version 4.4.0 in the root package.json
and in integration tests. Compared to version 4.3.0, which most of the
packages were previously depending on, it has the following changes:
Bug Fixes
- runner: remove explicit error on all tests failed
Features
- client: Add trusted types support
- Preprocessor can return Promise
- config: add failOnSkippedTests option.
- config: clientDisplayNone sets client elements display none.
- deps: Remove core-js dependency.
The motivation for upgrading the package is the Trusted Types support
that it adds, which is necessary to enable Trusted Types in Angular's
unit tests.
PR Close#39180
Zone.js 0.11.0 release an empty bundle, and now the npm_package tests all target
bazel rule `npm_package`, but not `npm_package.pack`, and these two rules may
generate different results, for example, Zone.js 0.11.0's issue is `package.json`
define files array which make the bundle only include the files in the files array.
So this PR install the zone.js package from the archive generated from `npm_package.pack` rule.
PR Close#38649