Skip to content

Disable on CI#116

Merged
sindresorhus merged 4 commits intosindresorhus:masterfrom
SimenB:skip-on-ci
Oct 30, 2017
Merged

Disable on CI#116
sindresorhus merged 4 commits intosindresorhus:masterfrom
SimenB:skip-on-ci

Conversation

@SimenB
Copy link
Copy Markdown
Contributor

@SimenB SimenB commented Jul 6, 2017

I don't think it makes sense to run on CI.

Hopefully this won't mess up update-notifier's own tests

https://ci.appveyor.com/project/lerna/lerna/build/1.0.1114/job/wry5k8q54m1qrw1c#L765

@SimenB
Copy link
Copy Markdown
Contributor Author

SimenB commented Jul 6, 2017

Of course this then fails in ci. Any way to mock out is-ci to return true? Not sure if proxyquire would even work because of the laziness.

@kevva
Copy link
Copy Markdown
Contributor

kevva commented Jul 6, 2017

Couldn't you just set the NO_UPDATE_NOTIFIER environment variable when running from your CI?

@SimenB
Copy link
Copy Markdown
Contributor Author

SimenB commented Jul 6, 2017

Absolutely, and that's what's probably gonna happen.

With npm@5 using this module though, I'm afraid everybody will get unwanted (and useless info) during CI runs whenever the bundled version of npm in node is not latest (which is the case for node 8 now).

It's a bit special case that it actually breaks Lerna's test suite since they assert on stdout after invoking node.

But I don't really see the use case you'd want the warning on CI.

@sindresorhus sindresorhus changed the title Disable on ci Disable on CI Sep 29, 2017
@sindresorhus
Copy link
Copy Markdown
Owner

This needs to be documented.

@SimenB
Copy link
Copy Markdown
Contributor Author

SimenB commented Oct 8, 2017

@sindresorhus I can add docs if we can get around the issue with the tests. Should I mock is-ci? If so, any preferred mocking implementations

@sindresorhus
Copy link
Copy Markdown
Owner

Should I mock is-ci? If so, any preferred mocking implementations

Sure, Sinon.js is good.

@SimenB
Copy link
Copy Markdown
Contributor Author

SimenB commented Oct 10, 2017

I wasn't able to mock using sinon as I needed to change the default export.

Ended up going with mock-require

@sindresorhus sindresorhus merged commit 38d5679 into sindresorhus:master Oct 30, 2017
@sindresorhus
Copy link
Copy Markdown
Owner

Looks good. Thank you @SimenB :)

@SimenB SimenB deleted the skip-on-ci branch October 30, 2017 05:50
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.

3 participants