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

Support specifying minimum Node version a test requires #5765

Merged
merged 1 commit into from May 25, 2017

Conversation

buunguyen
Copy link
Member

Q A
Patch: Bug Fix? no
Major: Breaking Change? no
Minor: New Feature? yes
Deprecations? no
Spec Compliancy? n/a
Tests Added/Pass? n/a
Fixed Tickets Implement #5752
License MIT
Doc PR no
Dependency Changes no

Add an option minNodeVersion so that test case can bail out if the current Node version isn't >= the expected version. This is to avoid having to check version in each test and do the eval hack (see #5752).

I can't figure out a good way to write automated test for this. I tested by adding options.json manually, changing minNodeVersion and observing behavior. I don't think an automated test is very important for this, but if you disagree, please let me know (and any idea to write this test is very welcome).

Also, there's a choice of making this change here or in transform-fixture-test-runner. I decided to bail out as early as possible, so here makes more sense.

@mention-bot
Copy link

@buunguyen, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo, @zertosh and @existentialism to be potential reviewers.

@hzoo
Copy link
Member

hzoo commented May 23, 2017

looks good, yeah we wouldn't need a test other than the usage of it like we needed 🙂 in the issue originally

@hzoo hzoo added the PR: Internal 🏠 A type of pull request used for our changelog categories label May 23, 2017
@codecov
Copy link

codecov bot commented May 23, 2017

Codecov Report

Merging #5765 into 7.0 will decrease coverage by 0.06%.
The diff coverage is 12.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##              7.0    #5765      +/-   ##
==========================================
- Coverage   84.65%   84.58%   -0.07%     
==========================================
  Files         282      282              
  Lines        9854     9862       +8     
  Branches     2766     2769       +3     
==========================================
  Hits         8342     8342              
- Misses        998     1005       +7     
- Partials      514      515       +1
Impacted Files Coverage Δ
packages/babel-helper-fixtures/src/index.js 71.62% <12.5%> (-7.17%) ⬇️
packages/babel-traverse/src/path/context.js 85.34% <0%> (-0.87%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8772e7f...6965450. Read the comment docs.

Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

anyone else have thoughts on the name? fine to me

}

// Delete to avoid option validation error
delete taskOpts.minNodeVersion;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we have to delete?

Copy link
Member Author

Choose a reason for hiding this comment

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

If not, the test will throw Unknown option: base.minNodeVersion. I suppose we can update OptionManager to support this option, but given it's only internally used, I'm not sure if we should do that.

Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

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

Since it uses semver, why not just {nodeVersion: ">4"}?

@buunguyen
Copy link
Member Author

That's an option too. Because here we explicitly want minimum version, I though qualifiers like '>', '<' or even range is not necessary. Specifying a single minimum version seems to be simplest for the purpose.

@hzoo hzoo merged commit 8abe061 into babel:7.0 May 25, 2017
@buunguyen buunguyen mentioned this pull request May 25, 2017
@buunguyen buunguyen deleted the test-node-version branch June 1, 2017 17:29
loganfsmyth pushed a commit to loganfsmyth/babel that referenced this pull request Apr 25, 2018
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: enhancement outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants