# Running build with TravisCI, the command npm run test returns the error: connection not open

**URL:** <https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754>\
**Category:** Support\
**Created:** [April 28, 2020, 10:11am UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754 "2020-04-28T10:11:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![m-yahya](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/m-yahya/32/2690_2.png) [@m-yahya](https://forum.openzeppelin.com/u/m-yahya)\
**Post date:** [April 28, 2020, 10:11am UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754/1 "2020-04-28T10:11:14Z")

</div>

@obernardovieira thank you very much for the blog ([Test smart contracts like a rockstar](https://forum.openzeppelin.com/t/test-smart-contracts-like-a-rockstar/1001)), very useful.  
However when running build with TravisCI, the command `npm run test` returns the error:  
connection not open

also, the command `npm run coverage` ultimately fails.

I understand a running instance of `ganache` is required but I’m not sure how we can fix this.  
any thoughts on this?  
thanks

---

<div class="post-metadata">

**Author:** ![obernardovieira](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/obernardovieira/32/15209_2.png) [@obernardovieira](https://forum.openzeppelin.com/u/obernardovieira)\
**Post date:** [April 29, 2020, 1:27pm UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754/2 "2020-04-29T13:27:01Z")

</div>

Hi @m-yahya

thank you so much. Appreciate it 🙏

I think that the problem is because when I first wrote the article, it was possible to run `truffle test` without having a ganache instance, because it would start its own instance. But then it changed, the article got updated for many other things, but not that one because, in fact, openzepplin was used to have a script and I still use. Since openzeppelin changed to [https://github.com/OpenZeppelin/openzeppelin-test-environment](https://github.com/OpenZeppelin/openzeppelin-test-environment), the environment " a local [ganache-powered blockchain](https://github.com/trufflesuite/ganache-core) with unlocked accounts will be spun up" so you don’t see it anywhere in code.

If you want to keep using truffle, I recommend you to look at an old version of openzeppelin where they used the script [https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.3.0/scripts/test.sh](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v2.3.0/scripts/test.sh) or at my work here [https://github.com/HQ20/starter-kit/blob/master/workspace-blockchain/scripts/test.sh](https://github.com/HQ20/starter-kit/blob/master/workspace-blockchain/scripts/test.sh) where I still use.  
Alternatively, you can start a ganache instance in a container with travis [https://github.com/HQ20/starter-kit/blob/master/.travis.yml#L15](https://github.com/HQ20/starter-kit/blob/master/.travis.yml#L15)

Hope this helps 👍

I’ll take some time to update the article. Many thanks 🙏

---

<div class="post-metadata">

**Author:** ![m-yahya](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/m-yahya/32/2690_2.png) [@m-yahya](https://forum.openzeppelin.com/u/m-yahya)\
**Post date:** [April 30, 2020, 5:04am UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754/3 "2020-04-30T05:04:00Z")

</div>

Thank you very much for the detailed information @obernardovieira.  
The use of [OpenZeppelin/openzeppelin-test-environment](https://github.com/OpenZeppelin/openzeppelin-test-environment) sounds great.

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [May 4, 2020, 6:23am UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754/4 "2020-05-04T06:23:54Z")

</div>

Hi @m-yahya and @obernardovieira,

Adding support for coverage is in the Q2 Roadmap for OpenZeppelin Test Environment:

> [@OpenZeppelin Test Environment – Roadmap Q2 2020](https://forum.openzeppelin.com/t/openzeppelin-test-environment-roadmap-q2-2020/2557):
>
> [OpenZeppelin Test Environment](https://docs.openzeppelin.com/test-environment) is a blazing fast test library for smart contracts. We use it [internally](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2007) at OpenZeppelin and managed to drop our Contracts tests suite CI time from 21 minutes to 12 minutes and bootstrap time from 50 seconds to 5 seconds . We are happy to announce we are looking to expand its feature set. After careful examination of the community’s feedback and brainstorming new ideas we are…

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [July 13, 2020, 5:32am UTC](https://forum.openzeppelin.com/t/running-build-with-travisci-the-command-npm-run-test-returns-the-error-connection-not-open/2754/5 "2020-07-13T05:32:59Z")

</div>

Split this topic on July 13, 2020, 5:32am UTC

A post was split to a new topic: [Support for eth-gas-reporter with OpenZeppelin Test Environment?](https://forum.openzeppelin.com/t/support-for-eth-gas-reporter-with-openzeppelin-test-environment/3306)
