coverage: {
host: 'localhost',
network_id: '48',
port: 7545,
gas: 17592186044415,
gasPrice: 1,
}
"ganache:coverage": "./node_modules/.bin/ganache-cli -p 7545 -g 1 -i 48 -l 17592186044415"
module.exports = {
norpc: false,
dir: '.',
copyPackages: ['openzeppelin-solidity'],
skipFiles: ['Migrations.sol','Pausable.sol', 'Ownable.sol', 'MockToken.sol', 'Destructible.sol']
};
When runnig my "test:coverage": "./node_modules/.bin/solidity-coverage", after starting ganache as described above, all the tests are passing but the last lines said:
26 passing (23s)
Cleaning up...
Event trace could not be read.
Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:coverage: `solidity-coverage`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:coverage script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/andreaspeziale/.npm/_logs/2018-11-15T08_28_24_685Z-debug.log
Changing my .solcover.js as follows:
module.exports = {
testrpcOptions: '-p 7545 -g 1 -i 48',
norpc: false,
dir: '.',
copyPackages: ['openzeppelin-solidity'],
skipFiles: ['Migrations.sol','Pausable.sol', 'Ownable.sol', 'MockToken.sol', 'Destructible.sol']
};
and so letting the solidity-coverage spawn ganache / testrpc (?) by itself everything goes well.
26 passing (18s)
........... table with results ...........
Istanbul coverage reports generated
Cleaning up...
Shutting down testrpc-sc (pid 10399)
Done.
The fact is that I don't like this working approach because it forces me to do this:
if (web3.version.network === '48') {
assert.include(
e.message,
'revert',
'Purchase can be performed also on when paused',
)
} else {
assert.include(
e.message,
'The contract is paused',
'Purchase can be performed also on when paused',
)
}
in the test since the current solidity-coverage ganache / testrpc (?) is not wrapping reason strings.
Any suggestions? Thanks guys for your work.
Any updates on this? Im also getting this
Truffle v5.0.15 (core: 5.0.15)
Node v9.11.1
Cleaning up...
Shutting down testrpc-sc (pid 55863)
Event trace could not be read.
Error: ENOENT: no such file or directory, open './allFiredEvents'
@justinkchen Do you fix this issue? I got this too and don't know what to do.
@justinkchen I have the same issue
I have solved the problem by running
touch allFiredEvents
before calling the solidity-coverage command. Not sure if this could work for you but it works in my case.
Update
No need to create allFiredEvents. It is fixed in the this working example here
I have tried this, but then it comes to zero coverage result. The contract I used is Metacoin.sol, so the contract itself has no problem and I don't know how to fix it.
Could you please give me all the command you have used to run solidity-coverage? Sorry to trouble you and thanks a lot.
该邮件从移动设备发送
--------------原始邮件--------------
发件人:"Ahmed Ali "notifications@github.com;
发送时间:2019年5月27日(星期一) 晚上10:32
收件人:"sc-forks/solidity-coverage" solidity-coverage@noreply.github.com;
抄送:"Meng Ren "renm8@mail2.sysu.edu.cn;"Comment "comment@noreply.github.com;
I have solved the problem by running
touch allFiredEvents
before calling the solidity-coverage command. Not sure if this could work for you but it works in my case.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
@renardbebe This example contains the configurations and commands I ran. It is a working example, so try to use the same configurations, and I hope this fixes your issue.
Oh it works!!!
Thanks a lot for your kindness!
任萌
Ren Meng
中山大学数据科学与计算机学院
School of Data and Computer Science, Sun Yat-sen University
软件工程专业
Software Engineering
------------------ Original ------------------
From: "Ahmed Ali"notifications@github.com;
Date: Tue, May 28, 2019 07:22 PM
To: "sc-forks/solidity-coverage"solidity-coverage@noreply.github.com;
Cc: "Meng Ren"renm8@mail2.sysu.edu.cn; "Mention"mention@noreply.github.com;
Subject: Re: [sc-forks/solidity-coverage] Using ganache-cli "Event trace could not be read" (#307)
@renardbebe This example contains the configurations and commands I ran. You are right it should work without my workaround.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
@renardbebe This example contains the configurations and commands I ran. It is a working example, so try to use the same configurations, and I hope this fixes your issue.
I tried that example and I still get the same problem :disappointed:
Any leads?
Truffle v5.0.22 (core: 5.0.22)
Node v10.15.3
Cleaning up...
Shutting down testrpc-sc (pid 29724)
Event trace could not be read.
Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...
@mariacao When I clone that example and run:
npm uninstall --dev solidity-coverage
npm install --dev solidity-coverage@beta
npx solidity-coverage
I see:

Could you try those steps and see if they work?
System: OSX
Node Version: 10
Truffle v5.0.12
Perfect! It worked! Thanks a lot
This seems to be about not realizing that it's required that you run the coverage-enabled client testrpc-sc which ships with solidity-coverage. If you're launching it separately, you also have to set norpc: true. See comment above for a link to a simple working example.
Most helpful comment
Any updates on this? Im also getting this
Truffle v5.0.15 (core: 5.0.15) Node v9.11.1 Cleaning up... Shutting down testrpc-sc (pid 55863) Event trace could not be read. Error: ENOENT: no such file or directory, open './allFiredEvents'