- Framework Chosen: pytest
- Rationale: pytest was chosen for its simple syntax, powerful fixtures, and native integration with many CI tools.
- Coverage: My tests cover the following:
GET /: Validates JSON structure, status code 200, and required fields.GET /health: Verifies the health check response and uptime incrementsGET /unknown: Verifies 404 response
-
Trigger Strategy: The workflow is triggered on:
-
pushto themainbranch. -
Versioning Strategy: SemVer
-
Rationale: SemVer was chosen because it clearly communicates breaking changes to users of the Docker image.
| Requirement | Evidence/Link |
|---|---|
| Successful Workflow Run | Link to GitHub Actions Run |
| Docker Hub Image | Link to Docker Hub Repository |
================================================================== test session starts ===================================================================
platform linux -- Python 3.13.9, pytest-9.0.2, pluggy-1.6.0
rootdir: /home/bulatgazizov/Projects/DevOps-Core-Course/app_python
plugins: anyio-4.9.0
collected 4 items
tests/test_main.py .... [100%]
=================================================================== 4 passed in 1.62s ====================================================================
-
Linting: Integrated
flake8to ensure code style consistency. -
Caching: Implemented
actions/setup-pythoncaching. -
Snyk Security: Integrated Snyk vulnerability scanning. >> Tested 55 dependencies for known issues, no vulnerable paths found.
-
Docker Metadata: Used
docker/metadata-actionfor automated, multi-tag management.
Versioning Strategy: I chose SemVer because it clearly says whether an update contains bug fixes (patch), new features (minor), or breaking changes (major).
Docker Tags: My CI generates the following tags:
latest: Always points to the most recent buildvX.Y.Z: Specific semantic versions based on Git tags.
Workflow Triggers: The workflow triggers on pushes to main or any other branch. This ensures all code is linted, tested, and scanned for vulnerabilities before integration.
Test coverage:
GET /: Validates JSON structure, status code 200, and required fields.GET /health: Verifies the health check response and uptime incrementsGET /unknown: Verifies 404 response