Requirements
-
Install
chromedriver. It is required to run tests from./apps/block_scout_webof the Umbrella application. -
This set of environment variables is required for each run of the test (
mix test) suite:Since v6.6.0, there are more flexible options for configuring the database used in testing. Refer to theTEST_DATABASE_URLandDATABASE_READ_ONLY_API_URLenvironment variables for more details.
Running tests
- Build assets.
cd apps/block_scout_web/assets && npm run build; cd - - Format Elixir code.
mix format - Lint Elixir code.
mix credo --strict - Run the dialyzer.
mix dialyzer --halt-exit-status - Check the Elixir code for vulnerabilities.
cd apps/explorer && mix sobelow --config; cd -cd apps/block_scout_web && mix sobelow --config; cd - - Lint JavaScript code.
cd apps/block_scout_web/assets && npm run eslint; cd - - Test JavaScript code.
cd apps/block_scout_web/assets && npm run test; cd - - Run separate test suites for the Umbrella application
-indexermix do ecto.create --quiet, ecto.migrate && cd apps/indexer && mix do compile, test --no-start && cd -
-explorermix do ecto.create --quiet, ecto.migrate && cd apps/explorer && mix do compile, test --no-start && cd -
-block_scout_webmix do ecto.create --quiet, ecto.migrate && cd apps/block_scout_web && mix do compile, test --no-start && cd -
-ethereum_jsonrpcmix do ecto.create --quiet, ecto.migrate && cd apps/ethereum_jsonrpc && mix do compile, test --no-start && cd -
Nethermind
Mox This is the default setup.mix test --no-start will work on its own, but to be explicit, use the following setup:
| Protocol | URL |
|---|---|
| HTTP | http://localhost:8545 |
| WebSocket | ws://localhost:8546 |
Geth
Mox| Protocol | URL |
|---|---|
| HTTP | https://mainnet.infura.io/8lTvJTKmHPCHazkneJsY |
| WebSocket | wss://mainnet.infura.io/ws/8lTvJTKmHPCHazkneJsY |