Skip to content

Conversation

@ai
Copy link
Contributor

@ai ai commented Oct 14, 2018

I have a case of:

  1. I have Node.js project with Yarn
  2. I must test Node 10, 8, 6, 4, 0.12, 0.8.
  3. Since most of the test tools don’t work on Node.js 0.12-0.8 I have custom install script which install dependencies only for Node 10-6.

Unfortunately, right now this case will not work with Travis since if Yarn doesn’t meet the requirement, Travis CI ignore custom install script and run npm install.

This PR should fix it and make this logic more predictable.

Copy link
Contributor

@BanzaiMan BanzaiMan left a comment

Choose a reason for hiding this comment

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

I don't think this is a change that we need to make.

I understand that your repo is having a little bit of difficulty, but I think in your case the best strategy is to skip install phases for older versions of node. See ai/nanoid#96

end
sh.else do
sh.cmd "yarn", retry: true, fold: 'install'
npm_install config[:npm_args]

This comment was marked as spam.

sh.if yarn_req_not_met do
sh.echo "Node.js version $(node --version) does not meet requirement for yarn." \
" Please use Node.js #{YARN_REQUIRED_NODE_VERSION} or later.", ansi: :red
npm_install config[:npm_args]

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@BanzaiMan
Copy link
Contributor

@ai Since you merged my PR, I'll assume that this PR is no longer necessary. :-)

@BanzaiMan BanzaiMan closed this Oct 14, 2018
@ai
Copy link
Contributor Author

ai commented Oct 14, 2018

Since you merged my PR, I'll assume that this PR is no longer necessary. :-)

Thanks for ai/nanoid#96. But I do not think it could help.

npm install will be called even on install: skip, since install_yarn called it, not install.

My project’s tests are passed because I replace yarn to npm.

@BanzaiMan BanzaiMan reopened this Oct 14, 2018
@ai
Copy link
Contributor Author

ai commented Oct 14, 2018

PR was fixed (hope you will squash all commits)

BanzaiMan added a commit that referenced this pull request Oct 15, 2018
Fix for custom install, yarn and old Node
@BanzaiMan
Copy link
Contributor

@BanzaiMan BanzaiMan changed the title Fix for custom install, yarn and old Node Skip running npm install when yarn requirement is not met Oct 15, 2018
@BanzaiMan BanzaiMan merged commit 4e57cca into travis-ci:master Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants