-
Notifications
You must be signed in to change notification settings - Fork 18
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
Code Coverage Support for Flow Emulator #132
Comments
@chrisackermann I've updated the |
Hi @m-Peter! Thanks for updating the details on the proposal - we've accepted the proposal and will be reaching out directly on next steps. Thanks! |
Hi @chrisackermann, I have revisited the proposal to also include Additionally, I'm excited to share that we had an excellent collaboration with developers from the Flow team, and the Milestone 1 of code coverage has progressed close enough to its completion 🙌 |
HI @m-Peter! Glad to hear that the collaboration has been awesome! Would you mind breaking out the Cadence Test Framework Improvements as its own grant in this case? In reading this now, I think it's better for us to manage these as separate grant proposals. Could you please remove from this one and submit as a separate proposal? Thanks! |
Hey @chrisackermann, I have separated the grant proposals 🙏 The new one can be found here. |
👋 @chrisackermann Just wanted to let you know, that as of yesterday, there is a new |
@m-Peter - this is excellent, thanks for this! |
Hey @chrisackermann , another version of flow-cli was released yesterday, which allows running integration tests as well as managing code coverage through the Emulator 🙏 |
@franklywatson The repository containing usage examples about code coverage has moved here: https://github.com/m-Peter/flow-code-coverage. This is where I will put samples for any new features. |
Code Coverage Support for Flow Emulator
Grant category
Description
The Flow Emulator is the developer tool for the Flow blockchain which allows the development of Cadence smart contracts, scripts and transactions. It is bundled with the
flow-cli
tool. Among the supported commands of theflow-cli
, there is also atest
command, which runs tests written with the Cadence testing framework, while utilizing the Flow Emulator under the hood. I would like to enrich thistest
command, to also provide coverage support, besides just running tests.Problem statement
Testing is an essential part of the development workflow, and code coverage is an important metric that can help developers view what percentage of all the possible code paths have been exercised! The Cadence core contributors have added support for code coverage a long time ago, but have not exposed this functionality to developers yet.
Proposed solution
The Flow Emulator provides code coverage functionality, when running tests with the Cadence testing framework, with a simple
flow-cli
command such as:A preliminary technical discussion can be found on the original issue in the
Wishlist
column.A high-level overview of possible changes to provide the desired functionality:
CoverageReportingEnabled
config flag, when we wish to generate aCoverageReport
, e.g:test
command of theflow-cli
tool, will need a new flag, e.g:tests
services package, should provide aCoverageReport
object, to the TestRunner, depending on the value of thecoverage
config flag, e.g:Impact
Developers will be able to measure how well their tests cover their contracts, and gain sufficient confidence before deploying to testnet, and more importantly on mainnet.
Milestones and funding
Total Cost: 60,000 USD.
Team
The text was updated successfully, but these errors were encountered: