Skip to content

build(docs-infra): switch the docs examples to Ivy and run unit tests for specific examples on CI#36143

Closed
gkalpak wants to merge 4 commits intoangular:masterfrom
gkalpak:build-aio-examples-ivy-and-tests
Closed

build(docs-infra): switch the docs examples to Ivy and run unit tests for specific examples on CI#36143
gkalpak wants to merge 4 commits intoangular:masterfrom
gkalpak:build-aio-examples-ivy-and-tests

Conversation

@gkalpak
Copy link
Copy Markdown
Member

@gkalpak gkalpak commented Mar 19, 2020

This PR switches the docs examples to Ivy (from ViewEngine) and also sets up unit tests for specific docs examples to run on CI. See individual commits for more details.

This was originally part of #34374 (and split off for easier reviewing).
Partially addresses: FW-1609

@pullapprove pullapprove Bot requested a review from kara March 19, 2020 14:43
@gkalpak gkalpak added area: build & ci Related the build and CI infrastructure of the project comp: docs-infra action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Mar 19, 2020
@ngbot ngbot Bot modified the milestone: needsTriage Mar 19, 2020
@gkalpak gkalpak requested a review from petebacondarwin March 19, 2020 14:49
@gkalpak gkalpak changed the title Build aio examples ivy and tests build(docs-infra): switch the docs examples to Ivy and run unit tests for specific examples on CI Mar 19, 2020
@mary-poppins
Copy link
Copy Markdown

Comment thread aio/content/examples/dependency-injection/example-config.json Outdated
Comment thread aio/content/examples/upgrade-phonecat-1-typescript/tsconfig.json Outdated
Comment thread aio/tools/examples/README.md Outdated
Comment thread aio/content/examples/testing/src/app/welcome/welcome.component.spec.ts Outdated
Comment thread aio/content/examples/testing/src/tests.sb.ts Outdated
Comment thread aio/content/examples/upgrade-phonecat-3-final/README.md Outdated
Comment thread aio/content/examples/http/example-config.json Outdated
@petebacondarwin
Copy link
Copy Markdown
Contributor

Oh and the 2nd commit has a typo:

is thruthy)

@petebacondarwin petebacondarwin added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Mar 19, 2020
@gkalpak gkalpak force-pushed the build-aio-examples-ivy-and-tests branch from f998038 to 6849e1b Compare March 19, 2020 19:01
@mary-poppins
Copy link
Copy Markdown

@gkalpak gkalpak removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: merge The PR is ready for merge by the caretaker labels Mar 19, 2020
@gkalpak gkalpak requested a review from petebacondarwin March 19, 2020 20:05
@gkalpak gkalpak added the action: merge The PR is ready for merge by the caretaker label Mar 19, 2020
@mary-poppins
Copy link
Copy Markdown

@gkalpak gkalpak force-pushed the build-aio-examples-ivy-and-tests branch from 9689940 to 4876279 Compare March 20, 2020 17:47
@mary-poppins
Copy link
Copy Markdown

@gkalpak gkalpak force-pushed the build-aio-examples-ivy-and-tests branch from 4876279 to b5f3156 Compare March 23, 2020 15:31
@kara kara added target: major This PR is targeted for the next major release target: patch This PR is targeted for the next patch release and removed target: patch This PR is targeted for the next patch release target: major This PR is targeted for the next major release labels Apr 6, 2020
@kara
Copy link
Copy Markdown
Contributor

kara commented Apr 6, 2020

@gkalpak The merge script is running into merge conflicts on master for some reason. Can you rebase to see if that helps?

@kara kara added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 6, 2020
gkalpak added 4 commits April 6, 2020 22:57
The docs examples are switched to Ivy. On CI, the tests are run with
both Ivy and ViewEngine.

Partially addresses:
[FW-1609](https://angular-team.atlassian.net/browse/FW-1609)
…les on CI

Previously, only e2e tests were run for docs examples on CI. As a
result, unit tests (which are included in the zipped archives we provide
for users to download and play with the examples locally) were often
outdated and broken.

This commit configures specific docs examples that have meaningful unit
tests to run them on CI (via the `run-example-e2e.js` script). Where
necessary, the unit tests are fixed to ensure they pass and reflect the
changes in the corresponding component/service.
This commit also removes some auto-generated unit tests that are not
meaningful (e.g. make trivial assertions, such that a component instance
is truthy) and are often broken anyway (e.g. because the corresponding
component has been changed in ways that make the tests fail).
…`core-js`

The `core-js` dependency is no longer included in `package.json` for
`cli`-type examples, but only for the `systemjs` ones. This commit
updates the `package.json` templates to reflect that (and also updates
the `npm-packages` guide accordingly).
… `tests`

Each docs example has an `example-config.json` configuration file. Among
other things, this file can be used to specify what commands to run in
order to test the example. (If not specified, the `run-example-e2e.js`
script will run a default `yarn e2e` command.)

Previously, the property specifying the test commands was called `e2e`.
This is because in the past only e2e tests were run for docs examples.
Since recently, some examples may specify commands for other types of
tests (such as unit tests). Therefore, calling the property that holds
the list of test commands `e2e` no longer makes sense and can be
misleading to people looking at the configuration files.

This commit renamed the property to the more generic `tests`. In the
future, the `run-example-e2e.js` script (and corresponding npm script)
should be renamed and refactored to also avoid giving the impression
that only e2e tests are run.

Discussed in:
angular#36143 (comment)
@gkalpak gkalpak force-pushed the build-aio-examples-ivy-and-tests branch from b5f3156 to 29ace22 Compare April 6, 2020 20:12
@mary-poppins
Copy link
Copy Markdown

@gkalpak gkalpak removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 6, 2020
@gkalpak gkalpak mentioned this pull request Apr 6, 2020
14 tasks
@kara kara closed this in aece366 Apr 6, 2020
kara pushed a commit that referenced this pull request Apr 6, 2020
…les on CI (#36143)

Previously, only e2e tests were run for docs examples on CI. As a
result, unit tests (which are included in the zipped archives we provide
for users to download and play with the examples locally) were often
outdated and broken.

This commit configures specific docs examples that have meaningful unit
tests to run them on CI (via the `run-example-e2e.js` script). Where
necessary, the unit tests are fixed to ensure they pass and reflect the
changes in the corresponding component/service.
This commit also removes some auto-generated unit tests that are not
meaningful (e.g. make trivial assertions, such that a component instance
is truthy) and are often broken anyway (e.g. because the corresponding
component has been changed in ways that make the tests fail).

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
…`core-js` (#36143)

The `core-js` dependency is no longer included in `package.json` for
`cli`-type examples, but only for the `systemjs` ones. This commit
updates the `package.json` templates to reflect that (and also updates
the `npm-packages` guide accordingly).

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
… `tests` (#36143)

Each docs example has an `example-config.json` configuration file. Among
other things, this file can be used to specify what commands to run in
order to test the example. (If not specified, the `run-example-e2e.js`
script will run a default `yarn e2e` command.)

Previously, the property specifying the test commands was called `e2e`.
This is because in the past only e2e tests were run for docs examples.
Since recently, some examples may specify commands for other types of
tests (such as unit tests). Therefore, calling the property that holds
the list of test commands `e2e` no longer makes sense and can be
misleading to people looking at the configuration files.

This commit renamed the property to the more generic `tests`. In the
future, the `run-example-e2e.js` script (and corresponding npm script)
should be renamed and refactored to also avoid giving the impression
that only e2e tests are run.

Discussed in:
#36143 (comment)

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
The docs examples are switched to Ivy. On CI, the tests are run with
both Ivy and ViewEngine.

Partially addresses:
[FW-1609](https://angular-team.atlassian.net/browse/FW-1609)

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
…les on CI (#36143)

Previously, only e2e tests were run for docs examples on CI. As a
result, unit tests (which are included in the zipped archives we provide
for users to download and play with the examples locally) were often
outdated and broken.

This commit configures specific docs examples that have meaningful unit
tests to run them on CI (via the `run-example-e2e.js` script). Where
necessary, the unit tests are fixed to ensure they pass and reflect the
changes in the corresponding component/service.
This commit also removes some auto-generated unit tests that are not
meaningful (e.g. make trivial assertions, such that a component instance
is truthy) and are often broken anyway (e.g. because the corresponding
component has been changed in ways that make the tests fail).

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
…`core-js` (#36143)

The `core-js` dependency is no longer included in `package.json` for
`cli`-type examples, but only for the `systemjs` ones. This commit
updates the `package.json` templates to reflect that (and also updates
the `npm-packages` guide accordingly).

PR Close #36143
kara pushed a commit that referenced this pull request Apr 6, 2020
… `tests` (#36143)

Each docs example has an `example-config.json` configuration file. Among
other things, this file can be used to specify what commands to run in
order to test the example. (If not specified, the `run-example-e2e.js`
script will run a default `yarn e2e` command.)

Previously, the property specifying the test commands was called `e2e`.
This is because in the past only e2e tests were run for docs examples.
Since recently, some examples may specify commands for other types of
tests (such as unit tests). Therefore, calling the property that holds
the list of test commands `e2e` no longer makes sense and can be
misleading to people looking at the configuration files.

This commit renamed the property to the more generic `tests`. In the
future, the `run-example-e2e.js` script (and corresponding npm script)
should be renamed and refactored to also avoid giving the impression
that only e2e tests are run.

Discussed in:
#36143 (comment)

PR Close #36143
@gkalpak gkalpak deleted the build-aio-examples-ivy-and-tests branch April 7, 2020 14:49
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 May 8, 2020
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 cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants