question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to integrate solidity-coverage to a framework. Receiving ''no such file or directory, open './allFiredEvents' error

See original GitHub issue

We’re developing a tool called etherlime, which is basically an ethereum development and deployment framework based on ethers.js. We want to integrate solidity-coverage in it. However, we always get this error:

Event trace could not be read.
Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...

In order to run the solidity-coverage I have created the following function

const runWithCoverage = async () => {
	var accountsData = ''
 	accounts.forEach(account => {
		let accountData = `--account "${account.secretKey},${account.balance.replace('0x', '')}" `;
		accountsData += accountData;
	});
	
	config["testrpcOptions"] = `${accountsData}`;
	const app = new App(config);
	app.generateCoverageEnvironment();
	app.instrumentTarget();
	app.launchTestrpc()
		.then(() => {
			app.runTestCommand();
			app.generateReport();
		})
		.catch(err => log(err));
}

The config variable contains the following object:

{
    "compileCommand": "etherlime compile --runs=999",
    "testCommand": "etherlime test",
    "copyPackages": ["zeppelin-solidity"],
    "port": 8545,
    "buildDirPath": "/build"
}

When the code is executed it uses by default testrpc-sc which comes from solidity-coverage. However, I keep getting the above error. Any ideas or advice will be very helpful.

Currently, the case can be tested using the etherlime with the etherlime-coverage branch here. There is a test project which can be used too.

Is it possible to integrate solidity-coverage in a framework like ours? The compilation process of the smart contracts in etherlime is based on truffle compile and the generated json files from our framework are the same.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
cgeweckecommented, Aug 19, 2018

@Perseverance Fantastic! Nice work.

2reactions
Perseverancecommented, Aug 19, 2018

@cgewecke Yes, It is working now. I rewrote the unit tests we were using and suddenly all started working. Etherlime now has an integrated solidity-coverage inside via the etherlime coverage command 😉

screen shot 2018-08-18 at 22 20 17
Read more comments on GitHub >

github_iconTop Results From Across the Web

sc-forks/solidity-coverage - Gitter
Hello, I am getting this error: Event trace could not be read. Error: ENOENT: no such file or directory, open './allFiredEvents'. How can...
Read more >
solcover fail to generate test coverage with my simple add ...
I want to use solcover to generate test coverage of my contract. ... originalContracts/Migrations.sol rm: no such file or directory: .
Read more >
Running solidity-coverage with truffle gives error: can not find ...
Solidity -coverage creates a temporary directory based on your folder directory, I reccomend changing your test command to just be a path to ......
Read more >
Unit Test & Coverage w/ Brownie (Pytest) - YouTube
Ethereum Smart Contract Programming tutorial with Solidity, featuring Brownie, Ganache, and 100% test coverage !In Part 4 of this series, ...
Read more >
Solidity and Truffle Continuous Integration Setup
But we have one problem, there won't be a blockchain available on the Travis CI machine. A simple fix for this is to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found