mirror of
https://github.com/johndoe6345789/docker-swarm-termina.git
synced 2026-04-24 13:45:01 +00:00
- Add pytest configuration with coverage reporting - Create test suite with 90+ test cases covering: - Authentication endpoints - Container management operations - Command execution functionality - Health checks and utilities - Add GitHub Actions workflow for automated testing - Runs on all pushes and PRs - Tests on Python 3.11 and 3.12 - Enforces 70% code coverage minimum - Validates Docker builds - Include test documentation and setup guides https://claude.ai/code/session_016vkdrUjnsBU2KMifxnJfSn
1.4 KiB
1.4 KiB
GitHub Actions Workflows
This directory contains GitHub Actions workflows for CI/CD automation.
Workflows
test.yml
Runs on every push and pull request to ensure code quality:
- Backend Tests: Runs pytest with coverage on Python 3.11 and 3.12
- Requires 70% test coverage minimum
- Uploads coverage reports to Codecov
- Frontend Tests: Lints and builds the Next.js frontend
- Docker Build Test: Validates Docker images can be built successfully
docker-publish.yml
Runs on pushes to main and version tags:
- Builds and pushes Docker images to GitHub Container Registry (GHCR)
- Creates multi-platform images for both backend and frontend
- Tags images with branch name, PR number, version, and commit SHA
create-release.yml
Handles release creation and management
Test Coverage Requirements
Backend tests must maintain at least 70% code coverage. The pipeline will fail if coverage drops below this threshold.
Local Testing
To run tests locally before pushing:
# Backend tests
cd backend
pip install -r requirements.txt -r requirements-dev.txt
pytest --cov=. --cov-report=term-missing
# Frontend build
cd frontend
npm install
npm run build
Adding New Tests
When adding new features:
- Write unit tests in
backend/tests/test_*.py - Ensure all tests pass locally
- Push changes - the CI will automatically run all tests
- Fix any failing tests before merging