Revert "Sync upstream 7.12.2022"

This commit is contained in:
a10zn8
2022-12-09 14:00:45 +04:00
committed by GitHub
parent 20564e58ba
commit dca78160ba
95 changed files with 8426 additions and 446 deletions

104
testing/README.adoc Normal file
View File

@@ -0,0 +1,104 @@
= Dshackle Integration Testing
Test for a correct work using a simulation of different upstream behaviours and checking the Dshackle against it.
.Modules:
- `dshackle` - Dshackle config used for testing environment
- `simple-upstream` - upstream simulator with predefines responses
- `trial` - actual tests
== How to run
NOTE: Run commands in project's root dir
NOTE: You need to open multiple consoles, since each command runs on foreground
== Basic Test
Makes some basic checks with a mocked upstreams
=== Run upstream emulator
.Runs two instances of RPC server
[source,bash]
----
DSHACKLE_TESTUP_PORT=18545 ./gradlew -p testing/simple-upstream run
DSHACKLE_TESTUP_PORT=18546 ./gradlew -p testing/simple-upstream run
----
=== Run Dshackle
[source,bash]
----
./gradlew run --args="--configPath=./testing/dshackle/dshackle-basic.yaml"
----
=== Run tests
[source,bash]
----
./testing/trial/gradlew -p testing/trial -PdshackleTrialMode=basic cleanTest test
----
== Real (Mainnet) Test
=== Run Dshackle
First you have to provide configuration to an upstream connected to the mainnet.
It may be a local Geth instance, or an other provider, like Infura (note that the test config doesn't support TLS or other auth)
[source,bash]
----
export DSHACKLE_TEST_ETH1_RPC=
export DSHACKLE_TEST_ETH1_WS=
export DSHACKLE_TEST_ETH1_WSORIGIN=
----
For a local Geth it would be:
[source,bash]
----
export DSHACKLE_TEST_ETH1_RPC=http://127.0.0.1:8545
export DSHACKLE_TEST_ETH1_WS=ws://127.0.0.1:8546
export DSHACKLE_TEST_ETH1_WSORIGIN=http://127.0.0.1:8546
----
Finally, run the Dshackle instance:
[source,bash]
----
./gradlew run --args="--configPath=./testing/dshackle/dshackle-real.yaml"
----
=== Run tests
[source,bash]
----
./testing/trial/gradlew -p testing/trial -PdshackleTrialMode=real cleanTest test
----
== Real (Rinkeby) Test
Runs requests against a Rinkeby Testnet.
Configuration is similar to the Mainnet config, but instead of `ETH1` is has `RINKEBY`.
[source,bash]
----
export DSHACKLE_TEST_RINKEBY_RPC=
export DSHACKLE_TEST_RINKEBY_WS=
export DSHACKLE_TEST_RINKEBY_WSORIGIN=
----
And run the Dshackle instance:
[source,bash]
----
./gradlew run --args="--configPath=./testing/dshackle/dshackle-rinkeby.yaml"
----
=== Run tests
[source,bash]
----
./testing/trial/gradlew -p testing/trial -PdshackleTrialMode=rinkeby cleanTest test
----