Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat: README.md for tests #51

Merged
merged 2 commits into from
Dec 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ docker compose --profile executor-service up -d
- You need to add the `--profile` flag to all commands, e.g. `docker compose --profile ... down`
- **Important**: The Executor Service must run on the `host` network. As detailed in docker's [documentation](https://docs.docker.com/network/host/), the `host` networking driver only works on Linux. This means Mac/Windows users cannot use this flag and must run the Executor Service natively on the host.

## Local integration tests

The integration tests are located in the `./tests` directory (see [README.md](./tests/README.md)).

## Env

A few environment variables are editable from the `.env` file found on the root of this repository.
Expand Down
39 changes: 39 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Description

These tests are designed to be executed locally against a running instance of the Local ERC20 messaging infrastructure. The tests are written as bash scripts, with each test being a separate file that can be run individually. Each test checks if the infrastructure is running, and if not, starts it. The tests then run and report the results. After the tests have completed, the infrastructure is stopped in the same script, so no need to stop it manually.
JDawg287 marked this conversation as resolved.
Show resolved Hide resolved

## Prerequisites

In addition to the prerequisites for the Local ERC20 messaging infrastructure, the following are required to run the tests:

- [Node.js](https://nodejs.org/en/)

## Running the tests

While being in the root of the repository, install the dependencies:

```sh
$ npm install
```

Then, edit the `.env` file to your liking. The default values should work for most cases. Then, source the `.env` file:

```sh
$ source .env
```

To run the tests, execute the tests from the root of the repository:

```sh
$ ./tests/<NAME_OF_TEST>.sh
# e.g. ./tests/test_network_health.sh
```

### Notes

- The tests use TypeScript scripts to interact with the infrastructure. These scripts can be found in the `./scripts` directory. Currently, there are two main scripts available:

- `get-certificate.ts`: Retrieves the certificate from the `ToposCore.sol` contract of a subnet.
- `send-token.ts`: Performs a token transfer transaction using the Topos Messaging Protocol, from one subnet to another, using the `ERC20Messaging.sol` contract.

- The smart contract artifacts are copied from `topos-sequencer` container to the `./artifacts` directory. These artifacts are then used by the TypeScript scripts to interact with the infrastructure. No need to copy them manually as the tests will take care of that automatically using a helper script, `./scripts/copy_contract_artifacts.sh`.
JDawg287 marked this conversation as resolved.
Show resolved Hide resolved
Loading