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

Refactor e2e tests #212

Merged
merged 7 commits into from
Sep 24, 2024
Merged

Refactor e2e tests #212

merged 7 commits into from
Sep 24, 2024

Conversation

ezdac
Copy link

@ezdac ezdac commented Sep 10, 2024

This is based on #202 - don't merge before that.

Adapts the e2e tests for the fee-currency changes in #202 and refactors the bash-based test-suite to a more modular design.

@ezdac ezdac marked this pull request as ready for review September 11, 2024 12:51
@ezdac ezdac force-pushed the ezdac/issue-177-e2e-test branch 2 times, most recently from cd4c33a to cb9fe72 Compare September 17, 2024 07:46
@ezdac ezdac requested a review from karlb September 19, 2024 13:44
Copy link

@karlb karlb left a comment

Choose a reason for hiding this comment

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

This is getting into "too much functionality for bash" territory...

e2e_test/debug-fee-currency/lib.sh Outdated Show resolved Hide resolved
e2e_test/run_all_tests.sh Outdated Show resolved Hide resolved
e2e_test/run_all_tests.sh Outdated Show resolved Hide resolved
e2e_test/debug-fee-currency/deploy_and_send_tx.sh Outdated Show resolved Hide resolved
e2e_test/js-tests/send_tx.mjs Outdated Show resolved Hide resolved
e2e_test/run_all_tests.sh Outdated Show resolved Hide resolved
e2e_test/shared.sh Show resolved Hide resolved
e2e_test/test_fee_currency_fails_on_debit.sh Outdated Show resolved Hide resolved
e2e_test/test_fee_currency_fails_on_debit.sh Outdated Show resolved Hide resolved
e2e_test/test_fee_currency_fails_on_debit.sh Outdated Show resolved Hide resolved
e2e_test/test_fee_currency_fails_on_credit.sh Outdated Show resolved Hide resolved
Since some e2e tests now produce invalidated transactions that remain
in the txpool until replaced, the `send_tx.mjs` script required some
changes to replace the sent CIP64 transaction. It will get replaced
after 2 blocks of producing no receipt.
Those changes also required the geth-node to run in periodic
--dev mode instead of the on-demand "produce-block-per-transaction"
mode, which
will unfortunately make the tests run longer than before.

The bash scripts and tests itself have also been refactored
to make code segments more reusable with the help of functions.
The geth-devmode predeployed "oracle3" is reused throughout the e2e
tests for all dynamically deployed fee-currencies.
However the tested fee-currencies are never removed from the
FeeCurrencyDirectory.

This causes the node to try to query exchange-rates for the leftover
fee-currencies. This fails, because the oracle associated with the old
fee-currency has a different token address assigned and thus causes a
revert. This issue is not critical and only causes emission of a log
message and some unneccessary evm calls,
but it is better practice to clean up the fee-currency from the
directory anyways.
@ezdac ezdac merged commit 1290c4a into celo8 Sep 24, 2024
7 checks passed
@ezdac ezdac deleted the ezdac/issue-177-e2e-test branch September 24, 2024 14:18
karlb pushed a commit that referenced this pull request Oct 11, 2024
* Revert "Temporarily skip fee-currency e2e tests"

This reverts commit 25314bc.

* Refactor e2e tests

Since some e2e tests now produce invalidated transactions that remain
in the txpool until replaced, the `send_tx.mjs` script required some
changes to replace the sent CIP64 transaction. It will get replaced
after 2 blocks of producing no receipt.
Those changes also required the geth-node to run in periodic
--dev mode instead of the on-demand "produce-block-per-transaction"
mode, which
will unfortunately make the tests run longer than before.

The bash scripts and tests itself have also been refactored
to make code segments more reusable with the help of functions.

* Fix js waitBlocks

* Fix e2e oracle reuse causing exchangeRate error

The geth-devmode predeployed "oracle3" is reused throughout the e2e
tests for all dynamically deployed fee-currencies.
However the tested fee-currencies are never removed from the
FeeCurrencyDirectory.

This causes the node to try to query exchange-rates for the leftover
fee-currencies. This fails, because the oracle associated with the old
fee-currency has a different token address assigned and thus causes a
revert. This issue is not critical and only causes emission of a log
message and some unneccessary evm calls,
but it is better practice to clean up the fee-currency from the
directory anyways.

* Remove accidentally checked in comment

* Reintroduce geth insta-mine in e2e tests

* Add replacement transaction related arguments to send_tx
piersy pushed a commit that referenced this pull request Oct 15, 2024
* Revert "Temporarily skip fee-currency e2e tests"

This reverts commit 25314bc.

* Refactor e2e tests

Since some e2e tests now produce invalidated transactions that remain
in the txpool until replaced, the `send_tx.mjs` script required some
changes to replace the sent CIP64 transaction. It will get replaced
after 2 blocks of producing no receipt.
Those changes also required the geth-node to run in periodic
--dev mode instead of the on-demand "produce-block-per-transaction"
mode, which
will unfortunately make the tests run longer than before.

The bash scripts and tests itself have also been refactored
to make code segments more reusable with the help of functions.

* Fix js waitBlocks

* Fix e2e oracle reuse causing exchangeRate error

The geth-devmode predeployed "oracle3" is reused throughout the e2e
tests for all dynamically deployed fee-currencies.
However the tested fee-currencies are never removed from the
FeeCurrencyDirectory.

This causes the node to try to query exchange-rates for the leftover
fee-currencies. This fails, because the oracle associated with the old
fee-currency has a different token address assigned and thus causes a
revert. This issue is not critical and only causes emission of a log
message and some unneccessary evm calls,
but it is better practice to clean up the fee-currency from the
directory anyways.

* Remove accidentally checked in comment

* Reintroduce geth insta-mine in e2e tests

* Add replacement transaction related arguments to send_tx
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