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

How to test the testnet #1130

Open
wakiyamap opened this issue Sep 13, 2024 · 6 comments
Open

How to test the testnet #1130

wakiyamap opened this issue Sep 13, 2024 · 6 comments

Comments

@wakiyamap
Copy link
Contributor

I am currently creating a pull request for testnet4.
https://github.com/wakiyamap/blockbook/commits/testnet4-bitcoin/

The testing method seems to be different from before, so I would like to confirm it.
If I were to test it, would the following command be okay?
make test

# make test
Image blockbook-build is up to date
docker run -t --rm -e PACKAGER=0:0 -v "/root/blockbook:/src" --network="host" blockbook-build make test ARGS=""
rm -rf /go/src/github.com/trezor/blockbook
mkdir -p /go/src/github.com/trezor
cp -r /src /go/src/github.com/trezor/blockbook
cd /go/src/github.com/trezor/blockbook && go mod download
sed -i 's/wsMessageSizeLimit\ =\ 15\ \*\ 1024\ \*\ 1024/wsMessageSizeLimit = 80 * 1024 * 1024/g' /go/pkg/mod/github.com/ava-labs/coreth*/rpc/websocket.go
cd /go/src/github.com/trezor/blockbook && go test -tags 'unittest' `go list ./... | grep -vP '^github.com/trezor/blockbook/(contrib|tests)'` 
?       github.com/trezor/blockbook     [no test files]
?       github.com/trezor/blockbook/bchain/coins        [no test files]
?       github.com/trezor/blockbook/bchain/coins/avalanche      [no test files]
ok      github.com/trezor/blockbook/api 0.076s
ok      github.com/trezor/blockbook/bchain      0.073s
ok      github.com/trezor/blockbook/bchain/coins/bch    0.070s
?       github.com/trezor/blockbook/bchain/coins/bsc    [no test files]
ok      github.com/trezor/blockbook/bchain/coins/bellcoin       0.080s
ok      github.com/trezor/blockbook/bchain/coins/bitcore        0.100s
ok      github.com/trezor/blockbook/bchain/coins/bitzeny        0.072s
?       github.com/trezor/blockbook/bchain/coins/cpuchain       [no test files]
ok      github.com/trezor/blockbook/bchain/coins/btc    0.107s
ok      github.com/trezor/blockbook/bchain/coins/btg    0.113s
ok      github.com/trezor/blockbook/bchain/coins/dash   0.088s
ok      github.com/trezor/blockbook/bchain/coins/dcr    0.107s
ok      github.com/trezor/blockbook/bchain/coins/deeponion      0.104s
ok      github.com/trezor/blockbook/bchain/coins/digibyte       0.079s
ok      github.com/trezor/blockbook/bchain/coins/divi   0.102s
ok      github.com/trezor/blockbook/bchain/coins/dogecoin       0.090s
ok      github.com/trezor/blockbook/bchain/coins/ecash  0.073s
ok      github.com/trezor/blockbook/bchain/coins/eth    0.082s
ok      github.com/trezor/blockbook/bchain/coins/firo   0.108s
ok      github.com/trezor/blockbook/bchain/coins/flo    0.083s
ok      github.com/trezor/blockbook/bchain/coins/fujicoin       0.118s
ok      github.com/trezor/blockbook/bchain/coins/gamecredits    0.115s
ok      github.com/trezor/blockbook/bchain/coins/grs    0.098s
ok      github.com/trezor/blockbook/bchain/coins/koto   0.078s
ok      github.com/trezor/blockbook/bchain/coins/liquid 0.105s
ok      github.com/trezor/blockbook/bchain/coins/litecoin       0.071s
ok      github.com/trezor/blockbook/bchain/coins/monacoin       0.112s
ok      github.com/trezor/blockbook/bchain/coins/monetaryunit   0.115s
ok      github.com/trezor/blockbook/bchain/coins/myriad 0.077s
ok      github.com/trezor/blockbook/bchain/coins/namecoin       0.082s
ok      github.com/trezor/blockbook/bchain/coins/nuls   0.065s
?       github.com/trezor/blockbook/bchain/coins/optimism       [no test files]
ok      github.com/trezor/blockbook/bchain/coins/omotenashicoin 0.081s
ok      github.com/trezor/blockbook/bchain/coins/pivx   0.072s
?       github.com/trezor/blockbook/bchain/coins/polygon        [no test files]
ok      github.com/trezor/blockbook/bchain/coins/polis  0.091s
ok      github.com/trezor/blockbook/bchain/coins/qtum   0.100s
ok      github.com/trezor/blockbook/bchain/coins/ravencoin      0.115s
ok      github.com/trezor/blockbook/bchain/coins/ritocoin       0.079s
ok      github.com/trezor/blockbook/bchain/coins/snowgem        0.079s
ok      github.com/trezor/blockbook/bchain/coins/trezarcoin     0.071s
?       github.com/trezor/blockbook/bchain/coins/utils  [no test files]
ok      github.com/trezor/blockbook/bchain/coins/unobtanium     0.106s
ok      github.com/trezor/blockbook/bchain/coins/vertcoin       0.096s
ok      github.com/trezor/blockbook/bchain/coins/viacoin        0.107s
?       github.com/trezor/blockbook/build/templates     [no test files]
?       github.com/trezor/blockbook/build/tools [no test files]
ok      github.com/trezor/blockbook/bchain/coins/vipstarcoin    0.077s
?       github.com/trezor/blockbook/build/tools/trezor-common   [no test files]
ok      github.com/trezor/blockbook/bchain/coins/zec    0.096s
?       github.com/trezor/blockbook/build/tools/typescriptify   [no test files]
ok      github.com/trezor/blockbook/common      0.016s
ok      github.com/trezor/blockbook/db  0.721s
ok      github.com/trezor/blockbook/fiat        0.220s
ok      github.com/trezor/blockbook/fourbyte    0.048s
ok      github.com/trezor/blockbook/server      0.562s

and

make test-integration ARGS="-v -run=TestIntegration/bitcoin_testnet4=main"

# make test-integration ARGS="-v -run=TestIntegration/bitcoin_testnet4=main"
Image blockbook-build is up to date
docker run -t --rm -e PACKAGER=0:0 -v "/root/blockbook:/src" --network="host" blockbook-build make test-integration ARGS="-v -run=TestIntegration/bitcoin_testnet4=main"
rm -rf /go/src/github.com/trezor/blockbook
mkdir -p /go/src/github.com/trezor
cp -r /src /go/src/github.com/trezor/blockbook
cd /go/src/github.com/trezor/blockbook && go mod download
sed -i 's/wsMessageSizeLimit\ =\ 15\ \*\ 1024\ \*\ 1024/wsMessageSizeLimit = 80 * 1024 * 1024/g' /go/pkg/mod/github.com/ava-labs/coreth*/rpc/websocket.go
cd /go/src/github.com/trezor/blockbook && go test -tags 'integration' `go list github.com/trezor/blockbook/tests/...` -v -run=TestIntegration/bitcoin_testnet4=main
?       github.com/trezor/blockbook/tests/dbtestdata    [no test files]
?       github.com/trezor/blockbook/tests/rpc   [no test files]
?       github.com/trezor/blockbook/tests/sync  [no test files]
=== RUN   TestIntegration
--- PASS: TestIntegration (0.00s)
testing: warning: no tests to run
PASS
ok      github.com/trezor/blockbook/tests       0.141s [no tests to run]
@martinboehm
Copy link
Contributor

We have added Testnet4 config by this commit d8c68f2. However we did not add integration tests yet. Would you mind if we take them from your fork and integrate them?

@wakiyamap
Copy link
Contributor Author

It's good, but I don't know if it will work.

@wakiyamap
Copy link
Contributor Author

Also, testnet4 does not work with the current github.com/martinboehm/btcutil/chaincfg.
Changes to bitcoinparser.go are required.
wakiyamap@a3690b3#diff-e8f35690e3557a170294ecf41264a45672b4667b0bec0cd08cc06954a34fb072R7

@grdddj
Copy link
Contributor

grdddj commented Oct 21, 2024

Hello, thanks for your work here! As mentioned by Martin above, we will cherry-pick your commit and synchronize it with current master - while leaving your authorship. I hope it is fine for you :)

@wakiyamap
Copy link
Contributor Author

Hello, thanks for your work here! As mentioned by Martin above, we will cherry-pick your commit and synchronize it with current master - while leaving your authorship. I hope it is fine for you :)

ok. no problem.

@wakiyamap
Copy link
Contributor Author

......So what is the correct test command for testnet?

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

No branches or pull requests

3 participants