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: add option to start karma without browser #17912

Merged

Conversation

devversion
Copy link
Member

Adds a way to start Karma without a browser. Similar to yarn gulp test:static.

The targets can be run the following way and work with ibazel watch
mode. yarn ibazel run src/cdk/a11y:unit_tests_static.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 10, 2019
@devversion
Copy link
Member Author

devversion commented Dec 10, 2019

Note: In the past we talked about this and said that we should just leave that to the rules_nodejs. Though there hasn't been any progress in regards to that. Since this is a common testing workflow (see debugging Ivy failures on IE10, IE11) and it could allow us getting rid of yarn gulp test... I spent time looking into this (exploring options etc.). This should be helpful for the upstream solution too.

We can consider this a PoC and move it over to rules_nodejs if we think it works good enough for us.

@devversion devversion marked this pull request as ready for review December 10, 2019 18:37
@devversion devversion requested a review from a team as a code owner December 10, 2019 18:37
@devversion devversion added pr: merge safe target: patch This PR is targeted for the next patch release labels Dec 10, 2019
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1429
native.sh_binary(
name = "%s_static" % name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this _local instead? That's the name we use inside Google and it would make it easier to remember

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I like that more. 👍

Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM

@@ -154,14 +154,38 @@ def ng_e2e_test_library(deps = [], tsconfig = None, **kwargs):
**kwargs
)

def karma_web_test_suite(deps = [], srcs = [], **kwargs):
def karma_web_test_suite(name = None, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make name a required parameter? Having it as non-required could get weird results

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@devversion devversion force-pushed the build/support-running-tests-in-static-mode branch from 2b0b133 to 543874a Compare December 11, 2019 16:55
Adds a way to start Karma without a browser. Similar to `yarn gulp
test:static`.

The targets can be run the following way and work with `ibazel` watch
mode. `yarn ibazel run src/cdk/a11y:unit_tests_local`.
@devversion devversion force-pushed the build/support-running-tests-in-static-mode branch from 543874a to e27b768 Compare December 11, 2019 17:03
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 11, 2019
@mmalerba mmalerba merged commit 993a027 into angular:master Dec 11, 2019
@angular-automatic-lock-bot
Copy link

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 11, 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 cla: yes PR author has agreed to Google's Contributor License Agreement 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