-
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
Cadence Testing Framework Major Uplift #216
Comments
An example of unit testing the built-in |
Status Update: 1st Milestone:
2nd Milestone:
As soon as a new |
Besides the Flow core repositories, I am adding one more migration from a community-driven project: |
Hey @franklywatson |
Great work. Thanks! |
Cadence Testing Framework
Grant category
Please select one:
Description
The Cadence Testing Framework has come a long way, after the completion of #148. It has been successfully used as the testing suite of https://github.com/onflow/hybrid-custody, enhancing the project's CI pipeline and DevEx. A number of other projects have been using the framework as well, including the
FungibleToken
andNonFungibleToken
standards plus some other community projects.Problem statement
After these first two iterations, we have identified some missing features which will make the framework feature-complete.
Up until now, there have been two types of testing: unit & integration tests. These two required a very different approach of testing, which resulted in some inconsistencies and a lack of features for both testing types. Unit tests were very limited in testing very primitive contracts, and integration tests could not make use of deployed contract types, which is one of the most needed features.
This lack of features is described here: onflow/cadence-tools#209
Proposed solution
To overcome all these limitations, we will unify the backend environment for both unit & integration tests. The emulator blockchain will no longer be exposed to the testing framework, as it will be just a singleton. Test code will have to deploy a contract prior to using it. The accounts where contracts are to be deployed, will be specified in the familiar
flow.json
config file, in a newly-introduced network (testing
). We have borrowed an idea from the Flow Playground, and will bootstrap the framework with 10 predefined accounts, for contract deployment. More details can be found in this post: https://forum.onflow.org/t/major-uplift-for-cadence-testing-framework/5232Impact
Provide
test
/development
parity, by allowing developers to write unit/integration tests in Cadence (https://12factor.net/dev-prod-parity). Developers will also 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 funding proposed: 7500 $
Team
The text was updated successfully, but these errors were encountered: