A REST API built with Flask to manage restaurant employees and work shifts.
Although the application provides a complete backend for employee scheduling, the main purpose of this repository is to showcase my Software QA and Test Automation skills. The project demonstrates how to test REST APIs using unit, integration, smoke, and performance testing, along with automated quality checks and continuous integration.
This repository highlights my experience with:
- Building automated API tests with pytest
- Writing unit, integration, smoke, and performance tests
- Testing REST endpoints, validation, and database workflows
- Measuring API performance with Locust
- Enforcing code quality with Ruff and Git hooks
- Running automated checks with GitHub Actions
- Flask
- Flask-SQLAlchemy
- SQLite
- Marshmallow
- pytest
- Requests
- Locust
- pytest-cov
- Ruff
- Lefthook
- GitHub Actions
- Astral uv
backend/
models/
app.py
database.py
schemas.py
tests/
integration/
performance/
smoke/
unit/
conftest.py
.github/workflows/
main.py
The tests/ folder contains different types of automated tests:
- Unit tests for API endpoints and validation
- Integration tests for complete employee and shift workflows
- Smoke tests to verify the API is running and responding
- Performance tests using Locust to simulate API traffic
- Python
- Astral uv
Install the project dependencies:
uv syncInstall the Git hooks:
uv run lefthook installStart the development server:
uv run main.pyThe API will be available at:
http://127.0.0.1:5000
| Method | Endpoint |
|---|---|
| GET | /employees |
| POST | /employees |
| GET | /employees/<id> |
| PUT | /employees/<id> |
| DELETE | /employees/<id> |
| Method | Endpoint |
|---|---|
| GET | /shifts |
| POST | /shifts |
| GET | /shifts/<id> |
| PUT | /shifts/<id> |
| DELETE | /shifts/<id> |
Run the complete test suite:
uv run pytestGenerate a coverage summary:
uv run task covGenerate an HTML coverage report:
uv run task coverage-reportRun the smoke tests:
uv run pytest tests/smoke/Run the performance tests:
uv run task perfGenerate a performance report:
uv run task perf-reportThe project currently has 99% test coverage.
The automated test suite validates:
- REST API endpoints
- Request validation
- CRUD operations
- Database relationships
- Employee and shift workflows
- Error handling
- API availability
- Performance under load
The project uses Lefthook to automatically run quality checks before code is committed.
The pre-commit workflow includes:
- Ruff formatting
- Ruff linting
- Automated pytest execution
Run the checks manually:
uv run ruff format .
uv run ruff check .GitHub Actions automatically runs quality checks whenever code is pushed to the repository.
The CI pipeline includes:
- Ruff linting
- Automated test execution
- Continuous validation of the codebase