Skip to content

ramir-dn/pytest-rp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XDistTest Docker Setup

This project uses Docker Compose to run pytest with ReportPortal integration in a containerized environment. To test xdist together with rp_hierarchy_code = True

Prerequisites

  • Docker and Docker Compose installed on your system
  • ReportPortal server setup (or access to an existing one)

Environment Variables

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.

Usage

1. Start the Container

To start the container and install dependencies:

docker compose up -d

This will:

  • Pull the Python 3.10.12 image
  • Install all dependencies from requirements.txt
  • Keep the container running in the background

2. Run Tests

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"

3. Access the Container Shell

If you need to access the container shell for debugging or running other commands:

docker compose exec python-app bash

4. Stop the Container

To stop the running container:

docker compose down

5. Complete Cleanup

To completely remove the container, networks, and volumes:

docker compose down -v --remove-orphans

To also remove the Docker image:

docker compose down -v --remove-orphans --rmi all

Project Structure

  • pytest.ini - pytest configuration with ReportPortal settings
  • requirements.txt - Python dependencies
  • test_root_pytest.py - Test files
  • docker-compose.yml - Docker Compose configuration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages