This project provides a Docker image for running tests with pytest and testinfra. The image is based on Python 3.9 and is designed to facilitate running tests in a containerized environment.
Before you begin, ensure you have:
- Docker: Installation instructions
- GitHub CLI (for interacting with GHCR, if needed): Installation instructions
To use this Docker image, you can either pull it from GitHub Container Registry (GHCR) or build it locally.
To pull the image from GHCR, use the following command:
docker pull ghcr.io/bengo237/pytest-testinfra:latestIf you prefer to build the image locally, clone this repository and run:
docker build -t my-python-image:latest .Once the image is built or pulled, you can use it to run your tests.
To run the tests with the Docker image, use the following command:
docker run --rm -v $(pwd):/app -w /app ghcr.io/bengo237/pytest-testinfra:latestThis command mounts the current directory into the container and runs pytest within that directory.
To build the Docker image, use the following command from the root of this repository:
docker build -t ghcr.io/bengo237/pytest-testinfra:latest .To publish the built image to GitHub Container Registry, make sure you are logged in to GHCR with Docker:
docker login ghcr.io -u <your-username> -p <your-github-token>Then push the image:
docker push ghcr.io/bengo237/pytest-testinfra:latestContributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a branch for your modification (
git checkout -b feature/YourFeature). - Commit your changes (
git commit -am 'Add some feature'). - Push the branch (
git push origin feature/YourFeature). - Open a pull request.
This project is licensed under the GPL-2.0 license.
- Prerequisites: Lists necessary tools for using the project.
- Installation: Instructions for pulling or building the Docker image.
- Usage: Shows how to run tests with the Docker image.
- Building and Publishing: Explains how to build and publish the Docker image.
- Contributing: Instructions for contributing to the project.
- License: Mentions the project's license.
Feel free to adjust this template to better fit your project's needs!