https://github.com/jmsdaq/pytest
Backend project showcasing pytest unit testing, GitLab CI/CD integration, and detailed test reports for QA automation.
https://github.com/jmsdaq/pytest
Last synced: 9 months ago
JSON representation
Backend project showcasing pytest unit testing, GitLab CI/CD integration, and detailed test reports for QA automation.
- Host: GitHub
- URL: https://github.com/jmsdaq/pytest
- Owner: jmsdaq
- Created: 2024-12-01T03:18:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T13:35:00.000Z (over 1 year ago)
- Last Synced: 2025-06-15T02:42:03.122Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Pytest-Centric Backend Testing Project
Welcome! This repository is built to showcase **pytest-driven testing** for a modular backend application. Designed with a QA mindset, it emphasizes clean, structured unit testing and smooth CI/CD integration via GitLab pipelines.
## Highlights
- **Pytest-Focused Testing:** Comprehensive unit tests for business logic and RESTful API endpoints.
- **Modular Architecture:** Includes models for `User`, `Product`, and `ShoppingCart`, with Flask routes for user and cart management.
- **GitLab CI/CD:** Automated pipeline to run tests and generate actionable reports on every commit.
## Project Layout
```bash
.
├── app/
│ ├── __init__.py # Initializes the Flask app
│ ├── models.py # User, Product, and Order models
│ ├── routes.py # REST API endpoints
│ ├── shopping_cart.py # ShoppingCart functionality
├── tests/
│ └── test_app.py # Pytest test cases
├── .gitlab-ci.yml # GitLab CI/CD pipeline configuration
├── requirements.txt # Project dependencies
└── README.md # You're reading it now!
```
## Setup
1. Clone the Repository:
```bash
git clone
```
2. Install Dependencies:
```bash
pip install -r requirements.txt
```
3. Run the Application:
```bash
python app.py
```
## Running Tests
- Run all tests:
```bash
pytest
```
- For detailed reports:
```bash
pytest -v --maxfail=1 --disable0warnings
```
## CI/CD Integration
The GitLab pipeline `(.gitlab-ci.yml)` ensures:
- Automated testing on every push.
- Easy integration of test reports for quick analysis.