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

test: enable unit tests to work with variable reference fee #5145

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

Conversation

vvysokikh1
Copy link
Collaborator

@vvysokikh1 vvysokikh1 commented Sep 20, 2024

High Level Overview of Change
This PR is a continuation of work done in: #5118
Fix remaining unit tests to be able to process reference fee value other than 10.

Context of Change
In preparation for potential reference fee change we would like to verify that fee change works as expected. The first step is to fix all unit tests to be able to work with different reference fee values.

Type of Change
[x ] Tests (you added tests for code that already exists, or your new feature included in this PR)
API Impact
None

Test Plan
Tested following reference fee values: 10, 20, 50, 100, 200, 500, 1000 by changing https://github.com/vvysokikh1/rippled/blob/2f432e812cb773048530ebfaf2e0e6def51e3cc2/src/test/jtx/impl/envconfig.cpp#L47

@vvysokikh1 vvysokikh1 changed the title [WIP] test: enable unit tests to work with variable reference fee test: enable unit tests to work with variable reference fee Sep 25, 2024
@vvysokikh1 vvysokikh1 marked this pull request as ready for review September 25, 2024 13:17
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.2%. Comparing base (1fbf8da) to head (f577d06).
Report is 2 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5145     +/-   ##
=========================================
- Coverage     76.2%   76.2%   -0.0%     
=========================================
  Files          760     760             
  Lines        61568   61568             
  Branches      8126    8126             
=========================================
- Hits         46909   46900      -9     
- Misses       14659   14668      +9     

see 6 files with indirect coverage changes

Impacted file tree graph

@Bronek
Copy link
Collaborator

Bronek commented Oct 14, 2024

Test Plan Tested following reference fee values: 10, 20, 50, 100, 200, 500, 1000 by changing https://github.com/vvysokikh1/rippled/blob/2f432e812cb773048530ebfaf2e0e6def51e3cc2/src/test/jtx/impl/envconfig.cpp#L47

Can you pls add a command line option to set this value ? It will probably go somewhere in app/main/Main.cpp (look for sections guarded by #ifdef ENABLE_TESTS )

@vvysokikh1
Copy link
Collaborator Author

vvysokikh1 commented Oct 15, 2024

Test Plan Tested following reference fee values: 10, 20, 50, 100, 200, 500, 1000 by changing https://github.com/vvysokikh1/rippled/blob/2f432e812cb773048530ebfaf2e0e6def51e3cc2/src/test/jtx/impl/envconfig.cpp#L47

Can you pls add a command line option to set this value ? It will probably go somewhere in app/main/Main.cpp (look for sections guarded by #ifdef ENABLE_TESTS )

This is actually quite tricky to do in runtime. Almost all tests allocate the Env and Config independently and it would require significant effort to propagate the fee value from startup params.

Feasible option is to make it compile time setting in CMake

@Bronek
Copy link
Collaborator

Bronek commented Oct 15, 2024

Test Plan Tested following reference fee values: 10, 20, 50, 100, 200, 500, 1000 by changing https://github.com/vvysokikh1/rippled/blob/2f432e812cb773048530ebfaf2e0e6def51e3cc2/src/test/jtx/impl/envconfig.cpp#L47

Can you pls add a command line option to set this value ? It will probably go somewhere in app/main/Main.cpp (look for sections guarded by #ifdef ENABLE_TESTS )

This is actually quite tricky to do in runtime. Almost all tests allocate the Env and Config independently and it would require significant effort to propagate the fee value from startup params.

Feasible option is to make it compile time setting in CMake

Yeah in that case just pls add an option to CMake (files RippledSettings.cmake and RippledCore.cmake); it is important that we can run unit tests with an arbitrary fee, so the new features do not revert to the hardcoded default 10.

@vvysokikh1
Copy link
Collaborator Author

Test Plan Tested following reference fee values: 10, 20, 50, 100, 200, 500, 1000 by changing https://github.com/vvysokikh1/rippled/blob/2f432e812cb773048530ebfaf2e0e6def51e3cc2/src/test/jtx/impl/envconfig.cpp#L47

Can you pls add a command line option to set this value ? It will probably go somewhere in app/main/Main.cpp (look for sections guarded by #ifdef ENABLE_TESTS )

This is actually quite tricky to do in runtime. Almost all tests allocate the Env and Config independently and it would require significant effort to propagate the fee value from startup params.
Feasible option is to make it compile time setting in CMake

Yeah in that case just pls add an option to CMake (files RippledSettings.cmake and RippledCore.cmake); it is important that we can run unit tests with an arbitrary fee, so the new features do not revert to the hardcoded default 10.

I've added a draft PR with this workflow added: #5159

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