solidity-coverage: Error parsing when using default configuration
When I run ./node_modules/.bin/solidity-coverage
after installing in my project, I get the following error.
Launching testrpc on port 8555
Launching test command (this can take a few seconds)...
Using network 'development'.
SyntaxError: Error parsing /home/travis/prg/protocol/coverageEnv/contracts/governance/GovernanceProtocol.sol: Expected "contract", "import", "library", "pragma", "using", comment, end of input, end of line, or whitespace but "e" found. Line: 6, Column: 31
at peg$buildStructuredError (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:543:12)
at Object.peg$parse [as parse] (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/build/imports_parser.js:4142:11)
at Object.parse (/usr/local/lib/node_modules/truffle/node_modules/solidity-parser/index.js:34:23)
at /usr/local/lib/node_modules/truffle/node_modules/truffle-compile/profiler.js:200:36
at /usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/index.js:79:5
at /usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/node_modules/async/internal/onlyOnce.js:12:16
at next (/usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/node_modules/async/whilst.js:68:18)
at /usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/index.js:64:7
at /usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/fs.js:65:5
at /usr/local/lib/node_modules/truffle/node_modules/truffle-resolver/node_modules/async/internal/once.js:12:16
Cleaning up...
There was an error generating coverage. Possible reasons include:
1. Another application is using port 8555
2. Truffle crashed because your tests errored
Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...
May be worth nothing that there is no configuration stub generated in my truffle.json
after this error, which should be there if I understand the readme correctly.
This is almost definitely something wrong on my end though, since it looks like you guys got it to work on the melonport protocol just fine, which is the code that I’m currently trying the coverage tool on.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (12 by maintainers)
@travs Oh good!!! Sorry about how brittle the testrpc launch is . . .it’s starting to look like we might need to make the ‘workaround’ the ‘actual way’.
@travs RE:
Invalid JSON RPC response: ""
. . . if you continue to run into it, there’s a workaround that maurelian just pinged me about. You can set an option callednorpc
in the.solcover.js
config file totrue
.Then in another window launch our custom testrpc from the command line like this:
That seems to work consistently.
Ok cool, I’ll check it out this afternoon.