test-reporting 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- test_reporting-1.0.0/LICENSE +21 -0
- test_reporting-1.0.0/PKG-INFO +391 -0
- test_reporting-1.0.0/README.md +357 -0
- test_reporting-1.0.0/reporting/__init__.py +6 -0
- test_reporting-1.0.0/reporting/classifier.py +109 -0
- test_reporting-1.0.0/reporting/cli.py +209 -0
- test_reporting-1.0.0/reporting/config.py +114 -0
- test_reporting-1.0.0/reporting/dashboard_generator.py +464 -0
- test_reporting-1.0.0/reporting/dashboard_generator_v2.py +819 -0
- test_reporting-1.0.0/reporting/history_dashboard.py +547 -0
- test_reporting-1.0.0/reporting/modern_design_system.py +393 -0
- test_reporting-1.0.0/reporting/overview_dashboard.py +1255 -0
- test_reporting-1.0.0/reporting/plugin.py +317 -0
- test_reporting-1.0.0/reporting/projects_dashboard.py +337 -0
- test_reporting-1.0.0/reporting/storage.py +1038 -0
- test_reporting-1.0.0/setup.cfg +4 -0
- test_reporting-1.0.0/setup.py +49 -0
- test_reporting-1.0.0/test_reporting.egg-info/PKG-INFO +391 -0
- test_reporting-1.0.0/test_reporting.egg-info/SOURCES.txt +21 -0
- test_reporting-1.0.0/test_reporting.egg-info/dependency_links.txt +1 -0
- test_reporting-1.0.0/test_reporting.egg-info/entry_points.txt +2 -0
- test_reporting-1.0.0/test_reporting.egg-info/requires.txt +4 -0
- test_reporting-1.0.0/test_reporting.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Your Organization
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: test-reporting
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Beautiful multi-project test reporting dashboard system
|
|
5
|
+
Home-page: https://github.com/amahdy77/test-reporting.git
|
|
6
|
+
Author: Ashfaqur Mahdy
|
|
7
|
+
Author-email: amahdy00@gmail.com
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Software Development :: Testing
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: pytest>=8.0.0
|
|
21
|
+
Provides-Extra: playwright
|
|
22
|
+
Requires-Dist: playwright>=1.40.0; extra == "playwright"
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: author-email
|
|
25
|
+
Dynamic: classifier
|
|
26
|
+
Dynamic: description
|
|
27
|
+
Dynamic: description-content-type
|
|
28
|
+
Dynamic: home-page
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: provides-extra
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
34
|
+
|
|
35
|
+
# 🚀 Test Reporting System
|
|
36
|
+
|
|
37
|
+
A beautiful, multi-project test reporting dashboard system for Playwright/Pytest with shared database support.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## ✨ Features
|
|
42
|
+
|
|
43
|
+
- 📊 **Beautiful Dashboards** - Interactive HTML dashboards with charts and metrics
|
|
44
|
+
- 🎯 **Multi-Project Support** - Multiple projects share one database
|
|
45
|
+
- 🔍 **Advanced Analytics** - Flaky tests, failure patterns, performance tracking
|
|
46
|
+
- 📈 **Trend Analysis** - Track quality over time
|
|
47
|
+
- 🎨 **Projects Landing Page** - Overview of all your test projects
|
|
48
|
+
- 🔒 **Concurrent Safe** - SQLite WAL mode for parallel test runs
|
|
49
|
+
- 📦 **Easy Integration** - Simple pip install and config
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 🚀 Quick Start
|
|
54
|
+
|
|
55
|
+
### **Installation**
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Install from PyPI
|
|
59
|
+
pip install test-reporting
|
|
60
|
+
|
|
61
|
+
# Or install from source for development
|
|
62
|
+
git clone https://github.com/yourusername/test-reporting.git
|
|
63
|
+
cd test-reporting
|
|
64
|
+
pip install -e .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### **Setup in Your Test Project**
|
|
68
|
+
|
|
69
|
+
1. **Add to conftest.py:**
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
# conftest.py
|
|
73
|
+
pytest_plugins = ['reporting.plugin']
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
2. **Create reporting.ini:**
|
|
77
|
+
|
|
78
|
+
```ini
|
|
79
|
+
# reporting.ini
|
|
80
|
+
[reporting]
|
|
81
|
+
project_name = My Test Project
|
|
82
|
+
db_path = test_results.db
|
|
83
|
+
dashboard_dir = dashboard
|
|
84
|
+
retention_days = 365
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. **Run tests:**
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pytest
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
4. **Generate dashboards:**
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
test-report generate
|
|
97
|
+
# or
|
|
98
|
+
python -m reporting.cli generate
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
5. **Open dashboards:**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
test-report open
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 📊 Dashboards
|
|
110
|
+
|
|
111
|
+
### **Projects Landing Page**
|
|
112
|
+
- Overview of all projects
|
|
113
|
+
- Health scores
|
|
114
|
+
- Quick metrics
|
|
115
|
+
- Click to drill down
|
|
116
|
+
|
|
117
|
+
### **Overview Dashboard**
|
|
118
|
+
- Overall health metrics
|
|
119
|
+
- Module breakdown
|
|
120
|
+
- Failure hotspots
|
|
121
|
+
- Quality trends
|
|
122
|
+
- Flaky tests
|
|
123
|
+
- Performance metrics
|
|
124
|
+
|
|
125
|
+
### **Run Details Dashboard**
|
|
126
|
+
- Latest test run details
|
|
127
|
+
- Test-by-test breakdown
|
|
128
|
+
- Screenshots and traces
|
|
129
|
+
- Error messages
|
|
130
|
+
- Execution logs
|
|
131
|
+
|
|
132
|
+
### **Test History**
|
|
133
|
+
- All test runs
|
|
134
|
+
- Search and filter
|
|
135
|
+
- Trend analysis
|
|
136
|
+
- Compare runs
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 🎯 Multi-Project Setup
|
|
141
|
+
|
|
142
|
+
### **Shared Database**
|
|
143
|
+
|
|
144
|
+
All projects can share one database:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
workspace/
|
|
148
|
+
├── shared_test_results.db ← Single database
|
|
149
|
+
│
|
|
150
|
+
├── project-a/
|
|
151
|
+
│ ├── tests/
|
|
152
|
+
│ └── reporting.ini ← project_name = Project A
|
|
153
|
+
│
|
|
154
|
+
├── project-b/
|
|
155
|
+
│ ├── tests/
|
|
156
|
+
│ └── reporting.ini ← project_name = Project B
|
|
157
|
+
│
|
|
158
|
+
└── project-c/
|
|
159
|
+
├── tests/
|
|
160
|
+
└── reporting.ini ← project_name = Project C
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Each project's data is tagged with its project name. The landing page shows all projects.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## ⚙️ Configuration
|
|
168
|
+
|
|
169
|
+
### **reporting.ini**
|
|
170
|
+
|
|
171
|
+
```ini
|
|
172
|
+
[reporting]
|
|
173
|
+
# Required: Unique project identifier
|
|
174
|
+
project_name = My Test Project
|
|
175
|
+
|
|
176
|
+
# Required: Database location (can be shared across projects)
|
|
177
|
+
db_path = test_results.db
|
|
178
|
+
|
|
179
|
+
# Optional: Dashboard output directory (default: dashboard)
|
|
180
|
+
dashboard_dir = dashboard
|
|
181
|
+
|
|
182
|
+
# Optional: Data retention in days (default: 365)
|
|
183
|
+
retention_days = 365
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### **Environment Variables (Alternative)**
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
export PROJECT_NAME="My Test Project"
|
|
190
|
+
export DB_PATH="test_results.db"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Config file takes precedence if it exists.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 🛠️ CLI Commands
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Generate all dashboards
|
|
201
|
+
test-report generate
|
|
202
|
+
|
|
203
|
+
# Generate and open in browser
|
|
204
|
+
test-report open
|
|
205
|
+
|
|
206
|
+
# Show quick stats
|
|
207
|
+
test-report stats
|
|
208
|
+
|
|
209
|
+
# Show suite statistics
|
|
210
|
+
test-report suites
|
|
211
|
+
|
|
212
|
+
# Clean up old data
|
|
213
|
+
test-report cleanup
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## 📈 Metrics Tracked
|
|
219
|
+
|
|
220
|
+
### **Top 10 Quick Win Metrics:**
|
|
221
|
+
|
|
222
|
+
1. **Retry Analysis** - Tests that needed retries
|
|
223
|
+
2. **Failure Type Breakdown** - Categorized failures
|
|
224
|
+
3. **Time to Recovery** - How long failures persist
|
|
225
|
+
4. **Performance Regressions** - Slower tests over time
|
|
226
|
+
5. **Failure Correlations** - Tests that fail together
|
|
227
|
+
6. **Error Message Search** - Common error patterns
|
|
228
|
+
7. **Test Age Analysis** - Old vs new test stability
|
|
229
|
+
8. **Soft Fail Analysis** - Timeout and flaky patterns
|
|
230
|
+
9. **Step-Level Failures** - Where tests break
|
|
231
|
+
10. **Module Health** - Health by test file
|
|
232
|
+
|
|
233
|
+
### **Core Metrics:**
|
|
234
|
+
|
|
235
|
+
- Pass rate (overall and functional)
|
|
236
|
+
- Test duration
|
|
237
|
+
- Flaky test detection
|
|
238
|
+
- Failure hotspots
|
|
239
|
+
- Quality trends
|
|
240
|
+
- Module health
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## 🔒 Concurrency
|
|
245
|
+
|
|
246
|
+
Uses SQLite WAL mode for safe concurrent writes:
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
# Multiple projects can run tests simultaneously
|
|
250
|
+
Project A → test_results.db ← Safe!
|
|
251
|
+
Project B → test_results.db ← Safe!
|
|
252
|
+
Project C → test_results.db ← Safe!
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 🎨 Screenshots
|
|
258
|
+
|
|
259
|
+
### Projects Landing Page
|
|
260
|
+
```
|
|
261
|
+
┌────────────────────────────────────────┐
|
|
262
|
+
│ 🚀 Test Automation Projects │
|
|
263
|
+
├────────────────────────────────────────┤
|
|
264
|
+
│ ┌──────────────────────────────────┐ │
|
|
265
|
+
│ │ ✅ Project A │ │
|
|
266
|
+
│ │ Health Score: 95% │ │
|
|
267
|
+
│ │ 120 Tests | 50 Runs │ │
|
|
268
|
+
│ │ [View Dashboard →] │ │
|
|
269
|
+
│ └──────────────────────────────────┘ │
|
|
270
|
+
│ ┌──────────────────────────────────┐ │
|
|
271
|
+
│ │ ⚠️ Project B │ │
|
|
272
|
+
│ │ Health Score: 78% │ │
|
|
273
|
+
│ │ 85 Tests | 30 Runs │ │
|
|
274
|
+
│ │ [View Dashboard →] │ │
|
|
275
|
+
│ └──────────────────────────────────┘ │
|
|
276
|
+
└────────────────────────────────────────┘
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## 🔧 Development
|
|
282
|
+
|
|
283
|
+
### **Setup for Development**
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
# Clone repo
|
|
287
|
+
git clone https://github.com/yourusername/test-reporting.git
|
|
288
|
+
cd test-reporting
|
|
289
|
+
|
|
290
|
+
# Install in editable mode
|
|
291
|
+
pip install -e .
|
|
292
|
+
|
|
293
|
+
# Make changes
|
|
294
|
+
# Test in your project
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### **Project Structure**
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
test-reporting/
|
|
301
|
+
├── reporting/
|
|
302
|
+
│ ├── __init__.py
|
|
303
|
+
│ ├── plugin.py # Pytest plugin
|
|
304
|
+
│ ├── storage.py # Database operations
|
|
305
|
+
│ ├── config.py # Configuration
|
|
306
|
+
│ ├── cli.py # CLI commands
|
|
307
|
+
│ ├── classifier.py # Failure classification
|
|
308
|
+
│ ├── overview_dashboard.py # Overview dashboard
|
|
309
|
+
│ ├── dashboard_generator_v2.py # Run details
|
|
310
|
+
│ ├── history_dashboard.py # Test history
|
|
311
|
+
│ └── projects_dashboard.py # Projects landing
|
|
312
|
+
├── setup.py
|
|
313
|
+
├── README.md
|
|
314
|
+
├── requirements.txt
|
|
315
|
+
└── .gitignore
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
## 📦 Requirements
|
|
321
|
+
|
|
322
|
+
- Python >= 3.9
|
|
323
|
+
- pytest >= 8.0.0
|
|
324
|
+
- playwright >= 1.40.0 (optional, for web tests)
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## 🚀 CI/CD Integration
|
|
329
|
+
|
|
330
|
+
### **Jenkins**
|
|
331
|
+
|
|
332
|
+
```groovy
|
|
333
|
+
stage('Run Tests') {
|
|
334
|
+
steps {
|
|
335
|
+
sh 'pytest'
|
|
336
|
+
sh 'test-report generate'
|
|
337
|
+
archiveArtifacts artifacts: 'dashboard/**/*'
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### **GitHub Actions**
|
|
343
|
+
|
|
344
|
+
```yaml
|
|
345
|
+
- name: Run Tests
|
|
346
|
+
run: pytest
|
|
347
|
+
|
|
348
|
+
- name: Generate Reports
|
|
349
|
+
run: test-report generate
|
|
350
|
+
|
|
351
|
+
- name: Upload Dashboards
|
|
352
|
+
uses: actions/upload-artifact@v2
|
|
353
|
+
with:
|
|
354
|
+
name: test-dashboards
|
|
355
|
+
path: dashboard/
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 📝 License
|
|
361
|
+
|
|
362
|
+
MIT License - See LICENSE file
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## 🤝 Contributing
|
|
367
|
+
|
|
368
|
+
1. Fork the repo
|
|
369
|
+
2. Create feature branch (`git checkout -b feature/amazing-feature`)
|
|
370
|
+
3. Make changes
|
|
371
|
+
4. Test thoroughly
|
|
372
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
373
|
+
6. Push to branch (`git push origin feature/amazing-feature`)
|
|
374
|
+
7. Open a Pull Request
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 📧 Support
|
|
379
|
+
|
|
380
|
+
- Issues: https://github.com/yourusername/test-reporting/issues
|
|
381
|
+
- Documentation: See README and SETUP_GUIDE.md
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## 🎉 Credits
|
|
386
|
+
|
|
387
|
+
Built with ❤️ for better test reporting
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
**Happy Testing!** 🚀📊✨
|