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

F/consumer rewards e2e #301

Merged
merged 28 commits into from
Nov 27, 2024
Merged

Conversation

maurolacy
Copy link
Contributor

@maurolacy maurolacy commented Nov 25, 2024

Adds rewards generation e2e test.

This first adapts / fixes the existing e2e tests to work with the new multi-contract setup.

Uses a sub-module to build the ibcsim-bcd container from the babylon-sdk reference; which is something that can clearly be improved. Perhaps in a follow-up?

Also, there are some (unrelated to staking integration) e2e tests that are failing. Commented them out in the test-e2e Makefile target. Sorted out this target so that is both up-to-date and depending on other existing targets, for robustness.
CI should use these targets as well. Perhaps in a follow-up?

@maurolacy maurolacy requested a review from a team as a code owner November 25, 2024 16:04
@maurolacy maurolacy requested review from gitferry and KonradStaniec and removed request for a team November 25, 2024 16:04
@maurolacy maurolacy changed the base branch from main to base/consumer-chain-support November 25, 2024 16:04
@maurolacy maurolacy changed the title F/consumer reward e2e F/consumer rewards e2e Nov 25, 2024
Copy link
Member

@SebastianElvis SebastianElvis left a comment

Choose a reason for hiding this comment

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

The test lgtm, great work! Only comment is about whether to use submodule or git clone for getting babylon-sdk repo. Also CI failed though

contrib/images/Makefile Outdated Show resolved Hide resolved
test/e2e/bcd_consumer_integration_test.go Show resolved Hide resolved
@SebastianElvis
Copy link
Member

Btw, shall we create a Github issue for moving the entire e2e-run-bcd-consumer-integration-test CI to babylon-sdk repo?

@maurolacy
Copy link
Contributor Author

maurolacy commented Nov 26, 2024

Btw, shall we create a Github issue for moving the entire e2e-run-bcd-consumer-integration-test CI to babylon-sdk repo?

We should, but sadly there are dependencies with babylon. The slashing tests, and in particular, the cascaded slashing ones, depend on babylon.

So, we should IMO duplicate (or better, replicate) the test setup in the babylon-sdk repo, for tests that are either independent of babylon, or in which babylon can be mocked or simulated. This is non-trivial, but can be done.

Also, writing more low-level unit tests for specific functionality, instead of comprehensive high-level e2e tests for it is a good idea, and something that we should try to incorporate.
By example, I could have unit-tested the rewards generation method in babylon-sdk, pretty much independently of all else. And then, I could perhaps have tested the contract -> sdk interaction somehow (by example, by making a test (gated under admin) entry point in the contract, to send the generate rewards custom message).

Unit tests in particular are relatively easy to write, and will give us more confidence (and a faster release cycle?) than writing complex e2e tests.

WDYT? Will document all this in the dev experience improvement issue, in any case.

Copy link
Member

@SebastianElvis SebastianElvis left a comment

Choose a reason for hiding this comment

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

Lgtm after replacing submodule with git clone 👍 great work on bumping contract setup

contrib/images/Makefile Outdated Show resolved Hide resolved
@SebastianElvis
Copy link
Member

So, we should IMO duplicate (or better, replicate) the test setup in the babylon-sdk repo, for tests that are either independent of babylon, or in which babylon can be mocked or simulated. This is non-trivial, but can be done.

Agreed, I think babylon-sdk will need to replicate the setup of babylon e2e test setup, so that babylon repo focuses on testing itself whereas the sdk repo tests the integration e2e.

Also, writing more low-level unit tests for specific functionality, instead of comprehensive high-level e2e tests for it is a good idea, and something that we should try to incorporate.
By example, I could have unit-tested the rewards generation method in babylon-sdk, pretty much independently of all else. And then, I could perhaps have tested the contract -> sdk interaction somehow (by example, by making a test (gated under admin) entry point in the contract, to send the generate rewards custom message).
Unit tests in particular are relatively easy to write, and will give us more confidence (and a faster release cycle?) than writing complex e2e tests.

Also agreed. For example, the reward generation can be tested solely on the babylon-sdk side. Have you tried to use https://github.com/babylonlabs-io/babylon-sdk/tree/main/tests/e2e and the admin accounts for testing this?

@maurolacy
Copy link
Contributor Author

Have you tried to use https://github.com/babylonlabs-io/babylon-sdk/tree/main/tests/e2e and the admin accounts for testing this?

That was my original plan, but I've spent so much time on this already, that I propose we left that as a follow-up issue / as part of https://github.com/babylonlabs-io/pm/issues/118.

@maurolacy maurolacy force-pushed the f/consumer-reward-e2e branch from bc7e89a to bc2e4bd Compare November 26, 2024 12:41
@maurolacy maurolacy force-pushed the f/consumer-reward-e2e branch from bc2e4bd to c71d416 Compare November 27, 2024 07:00
@maurolacy maurolacy merged commit ad3e100 into base/consumer-chain-support Nov 27, 2024
20 checks passed
@maurolacy maurolacy deleted the f/consumer-reward-e2e branch November 27, 2024 07:28
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