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

npm test not successful... #35

Open
lazydino opened this issue Feb 16, 2018 · 4 comments
Open

npm test not successful... #35

lazydino opened this issue Feb 16, 2018 · 4 comments

Comments

@lazydino
Copy link

lazydino commented Feb 16, 2018

Hi,
I am a newbie in Ethereum contract programming. I am testing the code in an ubuntu machine with node, testrpc and truffle. Here is what I got after running "npm test"

reggie@UBC809:~/mana$ npm test

> decentraland-crowdsale@1.0.0 test /home/reggie/mana
> ./scripts/test.sh

Using existing testrpc instance
Compiling ./contracts/BurnableToken.sol...
Compiling ./contracts/ContinuousSale.sol...
Compiling ./contracts/MANAContinuousSale.sol...
Compiling ./contracts/MANACrowdsale.sol...
Compiling ./contracts/MANAToken.sol...
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/WhitelistedCrowdsale.sol...
Compiling ./test/helpers/BurnableTokenMock.sol...
Compiling ./test/helpers/WhitelistedCrowdsaleImpl.sol...
Compiling zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol...
Compiling zeppelin-solidity/contracts/crowdsale/Crowdsale.sol...
Compiling zeppelin-solidity/contracts/crowdsale/FinalizableCrowdsale.sol...
Compiling zeppelin-solidity/contracts/lifecycle/Pausable.sol...
Compiling zeppelin-solidity/contracts/math/SafeMath.sol...
Compiling zeppelin-solidity/contracts/ownership/Ownable.sol...
Compiling zeppelin-solidity/contracts/token/BasicToken.sol...
Compiling zeppelin-solidity/contracts/token/ERC20.sol...
Compiling zeppelin-solidity/contracts/token/ERC20Basic.sol...
Compiling zeppelin-solidity/contracts/token/MintableToken.sol...
Compiling zeppelin-solidity/contracts/token/PausableToken.sol...
Compiling zeppelin-solidity/contracts/token/StandardToken.sol...
Error: Error: Exceeds block gas limit
    at StateManager.queueTransaction (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:90571:21)
    at GethApiDouble.eth_sendTransaction (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:90071:14)
    at GethApiDouble.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89870:10)
    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)
    at GethDefaults.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89767:12)
    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)
    at FilterSubprovider.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:65832:7)
    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)
    at DelayedBlockFilter.handleRequest (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:89595:3)
    at next (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59378:18)
    at Object.InvalidResponse (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:37047:16)
    at /home/reggie/mana/node_modules/truffle/build/cli.bundled.js:224634:36
    at XMLHttpRequest.request.onreadystatechange (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:223413:13)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:225286:18)
    at XMLHttpRequest._setReadyState (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:225576:12)
    at XMLHttpRequest._onHttpResponseEnd (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:225731:12)
    at IncomingMessage.<anonymous> (/home/reggie/mana/node_modules/truffle/build/cli.bundled.js:225691:24)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:188:7)
    at endReadableNT (_stream_readable.js:975:12)
npm ERR! Test failed.  See above for more details.
reggie@UBC809:~/mana$ node -v
v7.9.0
reggie@UBC809:~/mana$ npm -v
5.6.0

I don't have enough gas on testrpc?

@lazydino
Copy link
Author

Looks like I need to test on a faster machine with more memories. Some npm tests still failed, but it doesn't complain about gas limit now...

@marcelomorgado
Copy link

I've faced same problem and it's because test.sh is using global version of ganache-cli try to change this file on the same way that I did and try again.
https://github.com/decentraland/mana/pull/39/files
It's working here.

@bkirkmediallc
Copy link

Yes I believe that would work.

@0xnayan
Copy link

0xnayan commented Apr 10, 2023

1st install truffle like:
truffle install <package_name>
Then init truffle like:
truffle init
then test:
truffle test [<test_file>]
eg.
truffle test ./test/Burnable.js
** During testing make sure ganache is running
This may help you to run the test for this project.
..0xnayan

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

No branches or pull requests

9 participants
@lazydino @marcelomorgado @bkirkmediallc @0xnayan and others