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: run e2e btc tests locally #1868

Merged
merged 9 commits into from
Mar 12, 2024
Merged

Conversation

skosito
Copy link
Contributor

@skosito skosito commented Mar 8, 2024

Description

Purpose of this PR is to enable local btc e2e tests to be run separately with zetae2e run command.

  • add new command zetae2e setup-bitcoin [config] to be run whenever there is "no wallet" error from btc tests (because btc tests can be run locally in various contexts, sometimes wallet will be imported, sometimes not, for example if all local tests are run, running some of them separately will already have wallet) - readme had instructions for this, but it contained docker commands, this way there is cli command for this

  • fix bitcoin tests that when run manually were missing SetBtcAddress call (some had it, like bitcoin_deposit and stress test deposit)

  • tested with make start-localnet and after zetae2e setup-bitcoin [config] all btc tests and balance command worked

Closes: #1829

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Checklist:

  • I have added unit tests that prove my fix feature works

Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Looks like the right way to do it👍

cmd/zetae2e/README.md Show resolved Hide resolved
@lumtis
Copy link
Member

lumtis commented Mar 11, 2024

I'm getting this error when trying with the local.yml config

zetae2e setup-bitcoin cmd/zetae2e/config/local.yml
           | ⚙️ setting up TSS address
           | ⚙️ setting up Bitcoin account
           | ✅ Bitcoin account setup in 2.819375ms

panic: status code: 403, response: ""

goroutine 1 [running]:
github.com/zeta-chain/zetacore/e2e/runner.(*E2ERunner).SetupBitcoinAccount(0x14001ad5800, 0x1)
	/Users/lucas/go/src/github.com/zeta-chain/node/e2e/runner/setup_bitcoin.go:23 +0x1f4
main.runSetupBitcoin(0x140012cc000?, {0x14000e16b70?, 0x1?, 0x1?})
	/Users/lucas/go/src/github.com/zeta-chain/node/cmd/zetae2e/setup_bitcoin.go:72 +0x204
github.com/spf13/cobra.(*Command).execute(0x140012cc000, {0x14000e16b40, 0x1, 0x1})
	/Users/lucas/.gvm/pkgsets/go1.20/global/pkg/mod/github.com/spf13/[email protected]/command.go:940 +0x5c4
github.com/spf13/cobra.(*Command).ExecuteC(0x14000f34300)
	/Users/lucas/.gvm/pkgsets/go1.20/global/pkg/mod/github.com/spf13/[email protected]/command.go:1068 +0x340
github.com/spf13/cobra.(*Command).Execute(...)
	/Users/lucas/.gvm/pkgsets/go1.20/global/pkg/mod/github.com/spf13/[email protected]/command.go:992
main.main()
	/Users/lucas/go/src/github.com/zeta-chain/node/cmd/zetae2e/main.go:16 +0x28

Did you use: cmd/zetae2e/config/local.yml for the config?

This is an error typically happening if the user/pass is incorrect but here it seems to be good. I renamed the user into smoketest but the PR has not been merged yet.

@skosito
Copy link
Contributor Author

skosito commented Mar 11, 2024

Bitcoin account setup

i did this:

zetae2e setup-bitcoin cmd/zetae2e/config/local.yml
           | ⚙️ setting up TSS address
           | ⚙️ setting up Bitcoin account
           | ✅ Bitcoin account setup in 70.162959ms

           | * BTC setup done

and before that make start-localnet

could you please share more steps about setup you are doing locally before you are calling setup-bitcoin?

Copy link
Contributor

@kingpinXD kingpinXD left a comment

Choose a reason for hiding this comment

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

PR looks fine . the broken unit test might already be fixed in a separate pr , which you would need to rebase

@lumtis
Copy link
Member

lumtis commented Mar 12, 2024

Bitcoin account setup

i did this:

zetae2e setup-bitcoin cmd/zetae2e/config/local.yml
           | ⚙️ setting up TSS address
           | ⚙️ setting up Bitcoin account
           | ✅ Bitcoin account setup in 70.162959ms

           | * BTC setup done

and before that make start-localnet

could you please share more steps about setup you are doing locally before you are calling setup-bitcoin?

make zetanode
make start-localnet
zetae2e setup-bitcoin cmd/zetae2e/config/local.yml

@skosito skosito requested a review from lumtis March 12, 2024 12:14
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

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

Work well now!

@lumtis lumtis merged commit 7ed70a0 into develop Mar 12, 2024
21 checks passed
@lumtis lumtis deleted the test-run-e2e-btc-tests-locally branch March 12, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make zetae2e run work with Bitcoin on localnet
3 participants