peterbonnesoeur/test_containers_github_actions

test for test containers to see if they work for github actions

โ˜… 0Forks 0PythonGitHub โ†—Compare

README

Test Containers Demo

This project demonstrates the use of testcontainers-python for integration testing with Docker containers, specifically testing a Redis connection. The project uses GitHub Actions for continuous integration with the fast uv package installer.

๐Ÿš€ Features

  • Uses testcontainers-python to spin up a Redis container for testing
  • Implements a simple Redis connection test
  • GitHub Actions workflow with uv for fast dependency installation
  • Automatic container cleanup after tests

๐Ÿ› ๏ธ Requirements

  • Python 3.11+
  • Docker
  • uv (optional, for faster package installation)

๐Ÿ“ฆ Installation

  1. Clone the repository:
git clone <your-repo-url>
cd <repo-name>
  1. Install dependencies:
# Using pip
pip install -r requirements.txt

# Or using uv (faster)
uv pip install -r requirements.txt

๐Ÿงช Running Tests

Run the tests using pytest:

pytest -v

๐Ÿ”„ CI/CD

The project includes a GitHub Actions workflow that:

  • Runs on push to main and pull requests
  • Uses uv for fast dependency installation
  • Automatically runs the test suite

๐Ÿ“ License

MIT

Contributors

peterbonnesoeur

Issues