github.com/status-im/status-go@v1.1.0/integration-tests/README.MD (about)

     1  ## Overview
     2  
     3  Integration tests for status-go
     4  
     5  ## Table of Contents
     6  
     7  - [Overview](#overview)
     8  - [How to Install](#how-to-install)
     9  - [How to Run](#how-to-run)
    10    - [Running Tests](#running-tests)
    11  - [Implementation details](#implementation-details)
    12  
    13  ## How to Install
    14  
    15  * Install [Docker](https://docs.docker.com/engine/install/) and [Docker Compose](https://docs.docker.com/compose/install/)
    16  * Install [Python 3.10.14](https://www.python.org/downloads/)
    17  * In `integration-tests` directory, run `pip install -r requirements.txt`
    18  * **Optional (for test development)**: Use Python virtual environment for better dependency management. You can follow the guide [here](https://akrabat.com/creating-virtual-environments-with-pyenv/):
    19  
    20  ## How to Run
    21  
    22  ### Running dev RPC (anvil with contracts)
    23  - In `integration-tests` run `docker compose -f docker-compose.anvil.yml up --remove-orphans --build`, as result:
    24      * an [anvil](https://book.getfoundry.sh/reference/anvil/) container with ChainID 31337 exposed on `0.0.0.0:8545` will start running
    25      * Status-im contracts will be deployed to the network
    26  
    27  ### Run tests
    28  - In `integration-tests` run `docker compose -f docker-compose.anvil.yml -f docker-compose.test.status-go.yml up --build --remove-orphans`, as result:
    29      * a container with [status-go as daemon](https://github.com/status-im/status-go/issues/5175) will be created with APIModules exposed on `0.0.0.0:3333`
    30      * status-go will use [anvil](https://book.getfoundry.sh/reference/anvil/) as RPCURL with ChainID 31337 
    31      * all Status-im contracts will be deployed to the network
    32  
    33  * In `integration-tests/tests` directory run `pytest -m wallet` 
    34  
    35  ## Implementation details
    36  
    37  - Integration tests are implemented in `integration-tests/tests` based on [pytest](https://docs.pytest.org/en/8.2.x/)
    38  - Every test has two types of verifications:
    39      - `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.
    40      - `jsonschema.validate()` is used to check that the response contains expected data, including required fields and types. Schemas are stored in `/schemas/wallet_MethodName`
    41      - New schemas can be generated using `integration-tests/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