Commit graph

19 commits

Author SHA1 Message Date
Paul Gschwendtner
c7588683d1 build: always preserve symlinks when executing e2e test commands (#49293)
Currently, examples with test commands like `ng build` are *never*
using the local version of `//packages/compiler-cli`. This is because
the CLI is invoked accidentally from within `external/aio_example_deps`.

Since the CLI relies on importing the compiler-cli, it will always
resolve the dependency from that directory- causing it to be always
the version installed via `aio/examples/tools/shared/package.json`.

We should never resolve symlinks and escape the e2e sandbox. That way
the compiler-cli would be resolved properly and could also become the
locally built one, depending on the test mode (i.e. npm or "local").

PR Close #49293
2023-03-03 19:41:35 +00:00
Paul Gschwendtner
36b67152b9 build(docs-infra): fix example e2e tests not failing properly in some situations (#49293)
The `run-example-e2e` script does not properly fail if configured
tests of examples are failing. This happens when a CLI example
configures multiple tests in the `example-config`. Due to incorrect
usage of promises in combination with reduce, only the last test
command had an effect on the overall test conclusion.

A similar issue seems to occur with SystemJS Protractor tests.

This commit fixes the problem and also cleans up the code a little
by switching it to `async/await`.

PR Close #49293
2023-03-03 19:41:35 +00:00
Paul Gschwendtner
67679b3146 build: format run-example-e2e.mjs with prettier (#49293)
Formats the `run-example-e2e.mjs` file with prettier to ease
future diffs.

PR Close #49293
2023-03-03 19:41:35 +00:00
Derek Cormier
a61397f2f8 build(bazel): consolidate windows chromium path workaround
Add the hack to a central location so that it's easier to fix later.
2022-11-22 13:51:16 -07:00
Derek Cormier
f37dd0fc96 build(bazel): create AIO example playgrounds for manual testing
After the bazel migration, AIO examples are no longer fully formed in
the source tree.
2022-11-22 13:51:16 -07:00
Derek Cormier
474671568e build(bazel): fix aio example systemjs tests for locally linked packages
These required a preserveSymlinks hack similar to the CLI tests
2022-11-22 13:51:16 -07:00
Derek Cormier
7fd6f04df1 build(bazel): run aio systemjs example e2es concurrently
These had to be run with the 'exclusive' tag under bazel due to
hardcoded ports.
2022-11-22 13:51:16 -07:00
Derek Cormier
bc1e93d639 build(bazel): refactor aio example e2es to fix windows performance
Use the same config flag to enable local vs npm deps as aio.
2022-11-22 13:51:16 -07:00
Derek Cormier
7a134cf41a build(bazel): incrementally run aio example e2e tests
Replaces the workflow where all example e2es are run at once
2022-11-22 13:51:16 -07:00
George Kalpakas
89b5248e85 test(docs-infra): ensure examples are split correctly across shards (#46005)
Previously, the examples were split across shards based on the order in
which `globby()` returned them. This was based on the assumption that
`globby()`/the OS would list files in a deterministic order. However, it
turns out that examples can be listed in different orders between
executions, leading in them not being split correctly across shards on
CI (which further means that some examples may be tested multiple times
and others may not be tested at all).
You can see an example [here][1], where the `getting-started` example is
tested in both the 4th and 5th shards.

This commit fixes this by explicitly sorting the examples based on their
path.

[1]: https://circleci.com/gh/angular/angular/1165448

PR Close #46005
2022-05-16 09:35:42 -07:00
dario-piotrowicz
4708cd0000 docs(docs-infra): fix cosidered typo (#44987)
fix the "cosidered" typo (which should be "considered")

PR Close #44987
2022-02-07 09:45:21 -08:00
George Kalpakas
37e02750a7 build(docs-infra): fix SystemJS-based docs examples (#43868)
Previously, the SystemJS-based docs examples (typically `ngUpgrade`
examples) were not compatible with Angular v13 (due to the removal of
UMD bundles from the published packages).

This commit makes the examples compatible with Angular v13 and
re-enables the tests for all SystemJS-based examples on CI.

PR Close #43868
2021-11-08 17:01:16 +00:00
George Kalpakas
ef090d1347 test(docs-infra): improve debugging when docs example tests fail without exiting (#43683)
When the docs examples tests run with `--cliSpecsConcurrency` greater
than 1 (as happens on CI), the output of each process is [buffered][1]
(to avoid interleaved output from multiple, parallel processes) and is
only printed out once the process exits (either successfully or with an
error). However, in cases where a process did not exit, the buffered
output would be never printed out, thus making debugging the failure
harder. This is the case, for example, if a build error happens during
`ng e2e`. This can be seen in action in [this CI job][2], where the job
fails due to no output, but the error (which is an incompatible TS
version) is never printed out.

To make debugging such situations easier in the future, this commit
updates the `spawnExt()` helper to reject (causing the buffered output
to be printed out) if there is no output from the spawned process for
more than 5 minutes.

[1]: c721135e37/aio/tools/examples/run-example-e2e.mjs (L293)
[2]: https://circleci.com/gh/angular/angular/1061751

PR Close #43683
2021-10-06 10:04:47 -07:00
George Kalpakas
3be5716952 refactor(docs-infra): remove redundant code from run-example-e2e.mjs (#43683)
This commit removes some code that was unused or had no effect from the
`run-example-e2e.mjs` script.

PR Close #43683
2021-10-06 10:04:47 -07:00
Paul Gschwendtner
5b5adb17ec test(docs-infra): temporarily disable upgrade systemjs example e2e tests (#43431)
This commit temporarily disables the SystemJS upgrade e2e tests. All of
the upgrade e2e tests (except for `phonecat-1-typescript`) rely on UMD
bundles. These are no longer available for the v13 Angular package
output, so we disable the tests for now.

These e2e tests can be re-enabled once we migrated the exampels from
UMD bundles to e.g. the CLI, or some custom rollup build. Alternatively
it might be even possible to use FESM bundles directly (depending on
browser support for the AIO examples; this is something the docs-infra
team will have to determine though).

PR Close #43431
2021-10-01 18:28:46 +00:00
Paul Gschwendtner
72c12653e1 build(docs-infra): do not error if suites are ignored (#43431)
Adding suites to the `IGNORED_EXAMPLES` array currently results
in an runtime exception because later when ignored examples are
printed to stdout, a non-existent variable is referenced back
from when there were examples disabled due to the Ivy migration.

This commit fixes the logic.

PR Close #43431
2021-10-01 18:28:46 +00:00
George Kalpakas
93590895b5 build(docs-infra): update docs examples to Angular v12.1.3 (#42949)
This commit updates the docs examples to Angular v12.1.3. In addition to
updating the dependencies versions, it also updates the projects'
structure and configs to more closely match what a new v12 CLI app would
look like. See, also, the [diff][1] between a basic v11.2.11 CLI app and
a v12.1.3 one.

[1]: https://github.com/cexbrayat/angular-cli-diff/compare/11.2.11..12.1.3

PR Close #42949
2021-08-09 09:41:00 -07:00
Renovate Bot
648da4f8b5 build: update dependency globby to v12 (#42921)
PR Close #42921
2021-07-23 10:37:35 -07:00
George Kalpakas
19da73741d build(docs-infra): switch the example-e2e script to ESM (#42921)
Switch the JS script used for running the docs examples tests from
CommonJS to ESM format. This is necessary for upgrading the `globby`
dependency to [version 12.0.0][1] in a subsequent commit.

[1]: https://github.com/sindresorhus/globby/releases/v12.0.0

PR Close #42921
2021-07-23 10:37:35 -07:00
Renamed from aio/tools/examples/run-example-e2e.js (Browse further)