status-go/tests-functional
fbarbu15 74db631435
test_: contact requests tests (#6167)
test_: fewer nodes for multiple_contact_requests test

test_: fewer nodes for multiple_contact_requests test

test_: skip multiple_contact_requests test

test_: address review comments

test_: check messages just in event/messages

test_: get expected message by content type

test_: address review comments
2024-12-12 21:31:00 +02:00
..
clients test_: contact requests tests (#6167) 2024-12-12 21:31:00 +02:00
resources test_: contact requests tests (#6167) 2024-12-12 21:31:00 +02:00
schemas chore_: removed GetWalletToken because mobile not use it anymore (#6131) 2024-12-02 11:27:02 +00:00
tests test_: contact requests tests (#6167) 2024-12-12 21:31:00 +02:00
Dockerfile chore_: get version with go generate (#6014) 2024-11-03 00:47:15 +00:00
Dockerfile.tests-rpc chore_: rename integration tests to functional tests (#5908) 2024-10-03 14:51:51 +01:00
README.MD test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
config.json chore_: providers re-ordered 2024-10-21 17:30:51 +02:00
conftest.py test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
constants.py test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
docker-compose.anvil.dev.yml chore(Makefile)_: run-anvil command with dev ports mapping (#6155) 2024-12-04 14:03:25 +00:00
docker-compose.anvil.yml chore_: rename integration tests to functional tests (#5908) 2024-10-03 14:51:51 +01:00
docker-compose.status-go.local.yml test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
docker-compose.test.status-go.yml test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
entrypoint.sh chore_: rename integration tests to functional tests (#5908) 2024-10-03 14:51:51 +01:00
pytest.ini test_: restore account (#5960) 2024-10-23 22:48:33 +03:00
requirements.txt test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00
schema_builder.py test_: a little bit of refactoring 2024-10-14 12:47:58 +02:00
wallet_utils.py test_: run functional tests on host (no container) (#6159) 2024-12-12 13:45:21 +01:00

README.MD

Overview

Functional tests for status-go

Table of Contents

How to Install

  • Install Docker and Docker Compose
  • Install Python 3.10.14
  • In ./tests-functional, run pip install -r requirements.txt
  • Optional (for test development): Use Python virtual environment for better dependency management. You can follow the guide here:

How to Run

Running dev RPC (anvil with contracts)

  • In ./tests-functional run docker compose -f docker-compose.anvil.yml up --remove-orphans --build, as result:
    • an anvil container with ChainID 31337 exposed on 0.0.0.0:8545 will start running
    • Status-im contracts will be deployed to the network

Run tests

  • In ./tests-functional run docker compose -f docker-compose.anvil.yml -f docker-compose.test.status-go.yml -f docker-compose.status-go.local.yml up --build --remove-orphans, as result:
    • a container with status-backend will be created with endpoint exposed on 0.0.0.0:3333
    • status-go will use anvil as RPCURL with ChainID 31337
    • Status-im contracts will be deployed to the network
  • In ./tests-functional/tests directory run pytest -m rpc
  • To run tests against binary run pytest -m <your mark> --url=http:<binary_url>:<binary_port> --user_dir=/<path>

Implementation details

  • Functional tests are implemented in ./tests-functional/tests based on pytest
  • Every test has two types of verifications:
    • verify_is_valid_json_rpc_response() checks for status code 200, non-empty response, JSON-RPC structure, presence of the result field, and expected ID.
    • jsonschema.validate() is used to check that the response contains expected data, including required fields and types. Schemas are stored in /schemas/wallet_MethodName
    • New schemas can be generated using ./tests-functional/schema_builder.py by passing a response to the CustomSchemaBuilder(schema_name).create_schema(response.json()) method, should be used only on test creation phase, please search how to create schema: to see an example in a test