This project uses Docker Compose to run pytest with ReportPortal integration in a containerized environment.
To test xdist together with rp_hierarchy_code = True
- Docker and Docker Compose installed on your system
- ReportPortal server setup (or access to an existing one)
Before running the tests, you need to set the following environment variables in your shell:
export RP_ENDPOINT="https://your-reportportal-instance.com"
export RP_PROJECT="your_project_name"
export RP_API_KEY="your_api_key_here"Note: These environment variables must be set in the same shell session where you run the Docker Compose commands.
To start the container and install dependencies:
docker compose up -dThis will:
- Pull the Python 3.10.12 image
- Install all dependencies from
requirements.txt - Keep the container running in the background
To run pytest with ReportPortal integration - expect to get stuck:
docker compose exec python-app pytest --reportportal -o "rp_endpoint=$RP_ENDPOINT" -o "rp_project=$RP_PROJECT" -o "rp_api_key=$RP_API_KEY"If you need to access the container shell for debugging or running other commands:
docker compose exec python-app bashTo stop the running container:
docker compose downTo completely remove the container, networks, and volumes:
docker compose down -v --remove-orphansTo also remove the Docker image:
docker compose down -v --remove-orphans --rmi allpytest.ini- pytest configuration with ReportPortal settingsrequirements.txt- Python dependenciestest_root_pytest.py- Test filesdocker-compose.yml- Docker Compose configuration