Console-Test

console-test is a repository containing end-to-end tests for a console application using vega-market-sim. This README will guide you through setting up your environment and running the tests.

Prerequisites

Getting Started

  1. Install Poetry: Follow the instructions on the official Poetry website.
  2. Install Docker: Follow the instructions on the offical Docker website.
  3. Set up a Poetry environment:
    poetry shell
  4. Install the necessary dependencies:
    poetry install
  5. Install playwright:
    playwright install
  6. **Download the necessary binaries: Run the following command within your Python environment (use force so that the binaries are overwritten, current version depends on the environment you want to check):
    python -m vega_sim.tools.load_binaries --force --version $VEGA_VERSION
  7. Pull the docker image of the trading app: You can pull the image you want to test, for example:
    docker pull vegaprotocol/trading:develop
    or
    docker pull vegaprotocol/trading:main
    All available images can be found here.
  8. Start Docker: Make sure your Docker daemon is running.
  9. Run the tests: You can run tests with:
    poetry run pytest -s --headed

Running Specific Tests

To run a specific test, use the -k option followed by the name of the test:

poetry run pytest -k "order_match" -s

Running Tests in Parallel

If you want to run tests in parallel, use the --numprocesses auto option. --dist loadfile makes sure that there are no multiple runners assigned to single test file:

poetry run pytest -s --headed --numprocesses auto --dist loadfile