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

Add integration tests for sonictool. #381

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

LuisPH3
Copy link
Contributor

@LuisPH3 LuisPH3 commented Dec 19, 2024

This PR is part of https://github.com/Fantom-foundation/sonic-admin/issues/90

During the changes introduced to capture and handle every error in the codebase, sonictool is modified with new error paths; caused by error handling from previously ignored errors.
This PR adds automated testing for the sonictool subcommands, checking that execution of such is not compromised by the introduction of new error checks.

This PR introduces two changes outside of the test:

  • sonictool uses now UserPrompt for all terminal input, to facilitate testing. A proxy re-export of ethereum's UserPrompt is introduced to enable stdin redirect and mocking.
  • Non-closed network stack open during sonictool execution is now closed. Otherwise, tests introduced cannot reuse database within the same process.
  • New command line argument to change the db checkpoint generation interval, enabling to test sonictool heal command in a reasonable execution time.

@LuisPH3 LuisPH3 requested review from facuMH and removed request for facuMH December 19, 2024 14:10
facuMH
facuMH previously approved these changes Dec 19, 2024
Copy link
Contributor

@facuMH facuMH left a comment

Choose a reason for hiding this comment

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

awesome work !!!

tests/sonittool_test.go Outdated Show resolved Hide resolved
tests/sonittool_test.go Outdated Show resolved Hide resolved
This makes possible introduce early checkpoints and test sonictool heal options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants