Skip to content
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

build: switch to integration test rule from shared dev-infra package #44238

Closed
wants to merge 6 commits into from

Conversation

devversion
Copy link
Member

@devversion devversion commented Nov 20, 2021

Switches to the integration test rule from the shared dev-infra package, with the following benefits:

  • Full windows compatibility
  • No need for Puppeteer or Webdriver-manager. The bazel-managed Chromium can be used within tests, allowing for easier maintenance of the Chromium version etc.
  • Future use of RBE for integration tests (this will be a follow-up)
  • improved location/make variable expansion for commands w/ Bazel; environment settings; tool mappings etc (all of this can be seen in the dev-infra repo)

@google-cla google-cla bot added the cla: yes label Nov 20, 2021
@devversion devversion requested a review from josephperrott Nov 20, 2021
@devversion devversion added action: review comp: build & ci target: patch labels Nov 20, 2021
@ngbot ngbot bot added this to the Backlog milestone Nov 20, 2021
@ngbot ngbot bot added this to the Backlog milestone Nov 20, 2021
@ngbot ngbot bot added this to the Backlog milestone Nov 20, 2021
Copy link
Member

@gkalpak gkalpak left a comment

Yay for DRYness 🎉

I left a few minor comments/questions. Otherwise lgtm 👍
(Also, there's a typo in the last commit message: witin --> within 😇)

integration/README.md Show resolved Hide resolved
tools/npm_integration_test/BUILD.bazel Show resolved Hide resolved
integration/ngcc/test.sh Show resolved Hide resolved
integration/ngcc/BUILD.bazel Show resolved Hide resolved
integration/cli-hello-world-lazy/package.json Show resolved Hide resolved
Copy link
Member

@gkalpak gkalpak left a comment

:shipit:

@devversion devversion added action: merge and removed action: review labels Nov 21, 2021
JoostK
JoostK approved these changes Nov 21, 2021
Copy link
Member

@JoostK JoostK left a comment

Nice!

integration/index.bzl Outdated Show resolved Hide resolved
integration/README.md Outdated Show resolved Hide resolved
integration/index.bzl Outdated Show resolved Hide resolved
integration/index.bzl Show resolved Hide resolved
@devversion devversion requested review from josephperrott and removed request for IgorMinar Nov 30, 2021
@pullapprove pullapprove bot requested a review from crisbeto Nov 30, 2021
@pullapprove pullapprove bot requested a review from zarend Dec 2, 2021
@devversion
Copy link
Member Author

@devversion devversion commented Dec 2, 2021

@AndrewKushnir It's still up for review. I think the merge label just indicates that I would be confident landing this, but given there still pending a couple of blocking-reviews, I'll use the action review label instead. Thx for the heads up.

Copy link
Member

@josephperrott josephperrott left a comment

LGTM

@devversion devversion added action: merge PullApprove: disable and removed action: review labels Dec 7, 2021
@devversion
Copy link
Member Author

@devversion devversion commented Dec 7, 2021

FYI: Disabling pullapprove for the rest of the FW review groups which are only triggered due to the small BUILD.bazel changes.

@alxhub alxhub added target: minor and removed target: patch labels Dec 8, 2021
@alxhub
Copy link
Contributor

@alxhub alxhub commented Dec 8, 2021

This PR was merged into the repository by commit 2664bc2.

alxhub pushed a commit that referenced this issue Dec 8, 2021
…44238)

Wires up the integration test rule from the shared dev-infra package,
while also deleting the old integration test rule.

The readme is updated to reflect the changes that are being made
to run with the new integration rule. Overall one major difference is
that we will declare the integration test targets within each test
directory, making those actual bazel packages. This is more idiomatic
within Bazel and also reduces the computation within Skyframe as less
globs need to be evaluated for example.

PR Close #44238
alxhub pushed a commit that referenced this issue Dec 8, 2021
…egration test structure (#44238)

As mentioned in the previous commit, integration tests will be declared
in subpackages of `//integration`. For these tests to still rely on the
NPM packages from `HEAD`, we need to update the visibility.

PR Close #44238
alxhub pushed a commit that referenced this issue Dec 8, 2021
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
alxhub pushed a commit that referenced this issue Dec 8, 2021
)

Sets up the Bazel integration test with the new integration rule. This
commit is separate from the other changes because it required some
additional work. i.e.

The test has moved from `integration/bazel` to `integration/<..>/bazel`
where `<..>` is a new Bazel package defining the integration test.

This is necessary because we could not declare the integration test
within the `BUILD.bazel` file actually being part of the nested bazel
workspace. In those cases we can just define it at a higher-level and
use integration test `working_dir` attribute.

PR Close #44238
alxhub pushed a commit that referenced this issue Dec 8, 2021
…zel-managed chromium (#44238)

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
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…ipped rule (angular#44238)

The import ESM/CJS interop lint rule has been ported to the shared
dev-infra package, so we can remove the local version here.

PR Close angular#44238
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…ngular#44238)

Wires up the integration test rule from the shared dev-infra package,
while also deleting the old integration test rule.

The readme is updated to reflect the changes that are being made
to run with the new integration rule. Overall one major difference is
that we will declare the integration test targets within each test
directory, making those actual bazel packages. This is more idiomatic
within Bazel and also reduces the computation within Skyframe as less
globs need to be evaluated for example.

PR Close angular#44238
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…egration test structure (angular#44238)

As mentioned in the previous commit, integration tests will be declared
in subpackages of `//integration`. For these tests to still rely on the
NPM packages from `HEAD`, we need to update the visibility.

PR Close angular#44238
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…r#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 angular#44238
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…ular#44238)

Sets up the Bazel integration test with the new integration rule. This
commit is separate from the other changes because it required some
additional work. i.e.

The test has moved from `integration/bazel` to `integration/<..>/bazel`
where `<..>` is a new Bazel package defining the integration test.

This is necessary because we could not declare the integration test
within the `BUILD.bazel` file actually being part of the nested bazel
workspace. In those cases we can just define it at a higher-level and
use integration test `working_dir` attribute.

PR Close angular#44238
dimakuba pushed a commit to dimakuba/angular that referenced this issue Dec 28, 2021
…zel-managed chromium (angular#44238)

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 angular#44238
@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented Jan 8, 2022

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 Jan 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge cla: yes comp: build & ci PullApprove: disable target: minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants