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

test: Use common.hasIntl in tests related to ICU #10841

Closed
wants to merge 1 commit into from

Conversation

watilde
Copy link
Member

@watilde watilde commented Jan 16, 2017

We should use common.hasIntl in tests for test cases which are related to ICU. This way we can easily find the test cases that are Intl dependent. Plus, it will be able to make the tests a little faster if we check hasIntl first.

Refs: #10707 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
  • test
  • intl

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jan 16, 2017
if (!process.binding('config').hasIntl) {
common.skip('missing intl... skipping test');
if (!common.hasIntl) {
common.skip('missing Intl... skipping test');
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make the message just missing Intl please.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure thing! I will update the following tests then:

$ grep -ir 'missing Intl...' test/parallel/
test/parallel//test-icu-punycode.js:  common.skip('missing Intl... skipping test');
test/parallel//test-icu-stringwidth.js:  common.skip('missing Intl... skipping test');
test/parallel//test-whatwg-url-parsing.js:  common.skip('missing Intl... skipping test');
test/parallel//test-whatwg-url-setters.js:  common.skip('missing Intl... skipping test');

We should use `common.hasIntl` in tests for test cases which are related to ICU.
This way we can easily find the test cases that are Intl dependent.
Plus, it will be able to make the tests a little faster if we check hasIntl first.

Also, this tweaks the log messages to unify the message.

Refs: nodejs#10707
@italoacasas
Copy link
Contributor

@mscdex mscdex added the i18n-api Issues and PRs related to the i18n implementation. label Jan 16, 2017
const common = require('../common');
const assert = require('assert');
const readline = require('internal/readline');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep all of the require()s together where possible.

Copy link
Member

Choose a reason for hiding this comment

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

@mscdex If I'm not wrong, we are doing the same for crypto, where we require the additional modules only if common.hasCrypto is true.

@lpinca
Copy link
Member

lpinca commented Jan 19, 2017

@lpinca
Copy link
Member

lpinca commented Jan 19, 2017

Landed in 71650aa.

@lpinca lpinca closed this Jan 19, 2017
lpinca pushed a commit that referenced this pull request Jan 19, 2017
We should use `common.hasIntl` in tests for test cases which are
related to ICU.
This way we can easily find the test cases that are Intl dependent.
Plus, it will be able to make the tests a little faster if we check
hasIntl first.

Also, this tweaks the log messages to unify the message.

Refs: #10707
PR-URL: #10841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@watilde watilde deleted the feature/hasIntl branch January 19, 2017 09:04
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 25, 2017
We should use `common.hasIntl` in tests for test cases which are
related to ICU.
This way we can easily find the test cases that are Intl dependent.
Plus, it will be able to make the tests a little faster if we check
hasIntl first.

Also, this tweaks the log messages to unify the message.

Refs: nodejs#10707
PR-URL: nodejs#10841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 27, 2017
We should use `common.hasIntl` in tests for test cases which are
related to ICU.
This way we can easily find the test cases that are Intl dependent.
Plus, it will be able to make the tests a little faster if we check
hasIntl first.

Also, this tweaks the log messages to unify the message.

Refs: nodejs#10707
PR-URL: nodejs#10841
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
@MylesBorins
Copy link
Contributor

This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n-api Issues and PRs related to the i18n implementation. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants