Skip to content
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

Gear test lib #606

Merged
merged 38 commits into from Jan 28, 2022
Merged

Gear test lib #606

merged 38 commits into from Jan 28, 2022

Conversation

breathx
Copy link
Member

@breathx breathx commented Jan 24, 2022

Resolves #577. Closes #570 and closes #571 as not actual, because they're implemented in the lib.

Release Notes: It is a very handy tool that allows for total testing of the smart contract logic.
You can easily initialize the programs, send the messages and check the execution result in the log. The log can be checked for a specific message generated by the program execution and that's great since there may be several messages and it may be necessary to check not the last message, but some message that occurred during the program execution.
The tool makes it possible to increase the blockchain time and thus test the time-dependent logic in smart contracts. It also includes a helpful feature like creating mock contracts.

Copy link
Contributor

@shamilsan shamilsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome as an MVP but needs to be reviewed while adopting.

examples/ping/Cargo.toml Outdated Show resolved Hide resolved
gear-test-lib/src/lib.rs Outdated Show resolved Hide resolved
gear-test-lib/src/lib.rs Outdated Show resolved Hide resolved
gtest/src/manager.rs Outdated Show resolved Hide resolved
gtest/src/manager.rs Outdated Show resolved Hide resolved
gtest/src/manager.rs Outdated Show resolved Hide resolved
gtest/src/manager.rs Outdated Show resolved Hide resolved
@breathx breathx marked this pull request as ready for review January 25, 2022 14:07
@breathx breathx added A0-pleasereview PR is ready to be reviewed by the team C1-feature Feature request D4-test Autotests, and examples D5-tooling Helper tools and utilities labels Jan 25, 2022
@shamilsan shamilsan added the B1-releasenotes The feature deserves to be added to the Release Notes label Jan 27, 2022
Copy link
Member

@LouiseMedova LouiseMedova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a very handy tool that allows for total testing of the smart contract logic.
You can easily initialize the programs, send the messages and check the execution result in the log. The log can be checked for a specific message generated by the program execution and that's great since there may be several messages and it may be necessary to check not the last message, but some message that occurred during the program execution.
The tool makes it possible to increase the blockchain time and thus test the time-dependent logic in smart contracts. It also includes a helpful feature like creating mock contracts.

Copy link
Contributor

@shamilsan shamilsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent!

gtest/src/log.rs Show resolved Hide resolved
gtest/src/program.rs Show resolved Hide resolved
@breathx breathx added A2-mergeoncegreen PR is ready to merge after CI passes and removed A0-pleasereview PR is ready to be reviewed by the team labels Jan 28, 2022
@NikVolf
Copy link
Member

NikVolf commented Jan 28, 2022

It is a very handy tool that allows for total testing of the smart contract logic.
You can easily initialize the programs, send the messages and check the execution result in the log. The log can be checked for a specific message generated by the program execution and that's great since there may be several messages and it may be necessary to check not the last message, but some message that occurred during the program execution.
The tool makes it possible to increase the blockchain time and thus test the time-dependent logic in smart contracts. It also includes a helpful feature like creating mock contracts.

this looks like it worth putting as release notes @breathx

@breathx breathx merged commit 2cd8f90 into master Jan 28, 2022
@breathx breathx deleted the dn-gear-test-lib branch January 28, 2022 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-mergeoncegreen PR is ready to merge after CI passes B1-releasenotes The feature deserves to be added to the Release Notes C1-feature Feature request D4-test Autotests, and examples D5-tooling Helper tools and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a tool for testing programs Testing contracts with mocks Time-dependent tests in smart contracts
5 participants