py-vreport 0.2.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.
- py_vreport-0.2.0/.geminiignore +17 -0
- py_vreport-0.2.0/.github/workflows/publish.yml +35 -0
- py_vreport-0.2.0/.gitignore +32 -0
- py_vreport-0.2.0/.python-version +1 -0
- py_vreport-0.2.0/CHANGELOG.md +38 -0
- py_vreport-0.2.0/PKG-INFO +305 -0
- py_vreport-0.2.0/README.md +248 -0
- py_vreport-0.2.0/docs/vreport_desc.png +0 -0
- py_vreport-0.2.0/pyproject.toml +157 -0
- py_vreport-0.2.0/pytest.ini +17 -0
- py_vreport-0.2.0/src/py_vreport/__init__.py +7 -0
- py_vreport-0.2.0/src/py_vreport/cli.py +173 -0
- py_vreport-0.2.0/src/py_vreport/formatters.py +140 -0
- py_vreport-0.2.0/src/py_vreport/models.py +87 -0
- py_vreport-0.2.0/src/py_vreport/parser.py +193 -0
- py_vreport-0.2.0/src/py_vreport/py.typed +0 -0
- py_vreport-0.2.0/tests/README.md +259 -0
- py_vreport-0.2.0/tests/__init__.py +0 -0
- py_vreport-0.2.0/tests/conftest.py +152 -0
- py_vreport-0.2.0/tests/fixtures/malformed.xml +6 -0
- py_vreport-0.2.0/tests/fixtures/minimal_report.xml +36 -0
- py_vreport-0.2.0/tests/fixtures/report_all_pass.xml +30 -0
- py_vreport-0.2.0/tests/fixtures/report_empty.xml +8 -0
- py_vreport-0.2.0/tests/fixtures/report_nested_groups.xml +42 -0
- py_vreport-0.2.0/tests/fixtures/report_skipped_tests.xml +32 -0
- py_vreport-0.2.0/tests/fixtures/report_with_diagnostics.xml +92 -0
- py_vreport-0.2.0/tests/fixtures/report_with_failures.xml +70 -0
- py_vreport-0.2.0/tests/integration/__init__.py +0 -0
- py_vreport-0.2.0/tests/integration/test_cli.py +254 -0
- py_vreport-0.2.0/tests/unit/__init__.py +0 -0
- py_vreport-0.2.0/tests/unit/test_models.py +332 -0
- py_vreport-0.2.0/tests/unit/test_parser.py +287 -0
- py_vreport-0.2.0/tests/visual/__init__.py +0 -0
- py_vreport-0.2.0/tests/visual/__snapshots__/test_formatters.ambr +218 -0
- py_vreport-0.2.0/tests/visual/test_formatters.py +374 -0
- py_vreport-0.2.0/uv.lock +1306 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Ignore the environment and git history
|
|
2
|
+
.venv/
|
|
3
|
+
.git/
|
|
4
|
+
|
|
5
|
+
# Ignore build artifacts
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
|
|
9
|
+
# Ignore large data files in tests (keep the code, hide the blobs)
|
|
10
|
+
tests/data/*.can
|
|
11
|
+
tests/data/*.blf
|
|
12
|
+
|
|
13
|
+
# Ignore documentation assets if they are just images
|
|
14
|
+
docs/images/
|
|
15
|
+
|
|
16
|
+
# Ignore lock files (usually too long for AI to process usefully)
|
|
17
|
+
uv.lock
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*" # Triggers on tags starting with 'v', e.g., v1.0.0
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-n-publish:
|
|
10
|
+
name: Build and publish Python distributions
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
environment: pypi
|
|
13
|
+
permissions:
|
|
14
|
+
# IMPORTANT: This permission is required for Trusted Publishing
|
|
15
|
+
id-token: write
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v5
|
|
23
|
+
with:
|
|
24
|
+
version: "latest"
|
|
25
|
+
enable-cache: true
|
|
26
|
+
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
run: uv python install 3.11
|
|
29
|
+
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: uv build
|
|
32
|
+
|
|
33
|
+
- name: Publish to PyPI
|
|
34
|
+
# Using the official PyPA action is the recommended way for Trusted Publishing
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# --- Python/uv Specific ---
|
|
2
|
+
.venv/
|
|
3
|
+
__pycache__/
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
.ipynb_checkpoints/
|
|
7
|
+
|
|
8
|
+
# --- Build & Distribution ---
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
*.egg-info/
|
|
12
|
+
|
|
13
|
+
# --- Testing & Coverage ---
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.coverage
|
|
16
|
+
htmlcov/
|
|
17
|
+
.hypothesis/
|
|
18
|
+
|
|
19
|
+
# --- CAPL/Vector Specific (Optional but recommended) ---
|
|
20
|
+
# If you run tests that generate Vector-specific outputs
|
|
21
|
+
*.can.log
|
|
22
|
+
*.asc
|
|
23
|
+
*.blf
|
|
24
|
+
*.bak
|
|
25
|
+
|
|
26
|
+
# --- Tools/AI Specific ---
|
|
27
|
+
.aic/
|
|
28
|
+
|
|
29
|
+
# --- System/IDE ---
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
.DS_Store
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Initial release of **py_vreport**
|
|
11
|
+
- Modern CLI using Typer and Rich
|
|
12
|
+
- Fast XML parsing for Vector CANoe reports
|
|
13
|
+
- Detailed failure analysis with context logs
|
|
14
|
+
- UDS diagnostic data extraction and display
|
|
15
|
+
- Comprehensive test suite with 90%+ coverage
|
|
16
|
+
- Multi-file report processing support
|
|
17
|
+
|
|
18
|
+
## v0.2.0 (2026-01-25)
|
|
19
|
+
|
|
20
|
+
### Feat
|
|
21
|
+
|
|
22
|
+
- implement comprehensive test suite and update documentation
|
|
23
|
+
- add directory support and improve path validation in CLI
|
|
24
|
+
- refactor CLI to use Typer and separate from parser logic
|
|
25
|
+
- add detailed test case view and update documentation
|
|
26
|
+
- implement detailed report summary and CLI failure filtering
|
|
27
|
+
|
|
28
|
+
### Fix
|
|
29
|
+
|
|
30
|
+
- improve error handling and fix formatter method call
|
|
31
|
+
- resolve unexpected keyword argument 'err' in console.print calls
|
|
32
|
+
- correct syntax and typos in parser and update lockfile
|
|
33
|
+
|
|
34
|
+
### Refactor
|
|
35
|
+
|
|
36
|
+
- add new file cli.py to wrapp all logic into it & created new formatter to handle the printing
|
|
37
|
+
- fix UV pyproject file & update git ignore
|
|
38
|
+
- use explicit re-exports in __init__.py to satisfy linting rules
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: py-vreport
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A modern Python parser and CLI tool for Vector CANoe XML test reports with rich terminal output
|
|
5
|
+
Project-URL: Homepage, https://github.com/MohamedHamed19m/py_vreport
|
|
6
|
+
Project-URL: Repository, https://github.com/MohamedHamed19m/py_vreport
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/MohamedHamed19m/py_vreport/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/MohamedHamed19m/py_vreport#readme
|
|
9
|
+
Project-URL: Changelog, https://github.com/MohamedHamed19m/py_vreport/releases
|
|
10
|
+
Project-URL: Source Code, https://github.com/MohamedHamed19m/py_vreport
|
|
11
|
+
Author-email: MohamedHamed19m <mohamedahamed1915@gmail.com>
|
|
12
|
+
Maintainer-email: MohamedHamed19m <mohamedahamed1915@gmail.com>
|
|
13
|
+
License: MIT
|
|
14
|
+
Keywords: automotive,can,canoe,cli,diagnostic,ecu,parser,test-analysis,test-automation,test-report,test-results,testing,uds,vector,vector-canoe,xml
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Environment :: Console
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: Intended Audience :: Manufacturing
|
|
19
|
+
Classifier: Intended Audience :: Science/Research
|
|
20
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
21
|
+
Classifier: Operating System :: MacOS
|
|
22
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
23
|
+
Classifier: Operating System :: OS Independent
|
|
24
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
25
|
+
Classifier: Programming Language :: Python :: 3
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
29
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
30
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
31
|
+
Classifier: Topic :: Software Development :: Testing
|
|
32
|
+
Classifier: Topic :: System :: Hardware :: Universal Serial Bus (USB)
|
|
33
|
+
Classifier: Topic :: Utilities
|
|
34
|
+
Classifier: Typing :: Typed
|
|
35
|
+
Requires-Python: >=3.11
|
|
36
|
+
Requires-Dist: lxml>=6.0.2
|
|
37
|
+
Requires-Dist: pandas>=3.0.0
|
|
38
|
+
Requires-Dist: rich>=13.0.0
|
|
39
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
42
|
+
Requires-Dist: commitizen; extra == 'dev'
|
|
43
|
+
Requires-Dist: hypothesis>=6.82.0; extra == 'dev'
|
|
44
|
+
Requires-Dist: mypy>=1.7.0; extra == 'dev'
|
|
45
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
46
|
+
Requires-Dist: pytest-mock>=3.11.0; extra == 'dev'
|
|
47
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
48
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
49
|
+
Requires-Dist: syrupy>=4.0.0; extra == 'dev'
|
|
50
|
+
Provides-Extra: test
|
|
51
|
+
Requires-Dist: hypothesis>=6.82.0; extra == 'test'
|
|
52
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
|
|
53
|
+
Requires-Dist: pytest-mock>=3.11.0; extra == 'test'
|
|
54
|
+
Requires-Dist: pytest>=7.4.0; extra == 'test'
|
|
55
|
+
Requires-Dist: syrupy>=4.0.0; extra == 'test'
|
|
56
|
+
Description-Content-Type: text/markdown
|
|
57
|
+
|
|
58
|
+
# py_vreport
|
|
59
|
+
|
|
60
|
+
**py_vreport** is a modern Python tool designed to parse, analyze, and summarize **Vector CANoe XML Test Reports**.
|
|
61
|
+
|
|
62
|
+
It provides a powerful command-line interface (CLI) using Typer and Rich to quickly extract test results, identify failures, and view detailed diagnostic contextโall from your terminal, without needing to open the full HTML/XML report in a browser.
|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+
## โจ Features
|
|
67
|
+
|
|
68
|
+
- **๐ Fast Parsing**: Efficiently parses large CANoe XML report files
|
|
69
|
+
- **๐ Summary Views**: Get quick overviews of test modules, total tests, and pass/fail counts
|
|
70
|
+
- **๐ Detailed Failure Analysis**:
|
|
71
|
+
- View failure context (logs leading up to the failure)
|
|
72
|
+
- Inspect diagnostic data (UDS requests/responses) associated with failures
|
|
73
|
+
- See exactly where and why tests failed
|
|
74
|
+
- **๐ฌ Detailed Test Case Inspection**: View every test step, its result, and associated diagnostic data for specific test cases
|
|
75
|
+
- **๐ Multi-file Support**: Process multiple report files in a single batch operation
|
|
76
|
+
- **๐จ Rich Terminal Output**: Beautifully formatted output with colors, tables, and panels powered by Rich
|
|
77
|
+
- **๐ฆ Clean Architecture**: Separated parser library from CLI for programmatic use
|
|
78
|
+
- **๐ค AI-Agent Integration**: Designed to work seamlessly with AI agents (like Gemini CLI). You can pipe report data directly into an LLM to:
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
## ๐ Requirements
|
|
82
|
+
|
|
83
|
+
- **Python 3.11+**
|
|
84
|
+
- Dependencies managed via `uv` (recommended) or `pip`
|
|
85
|
+
|
|
86
|
+
## ๐ง Installation
|
|
87
|
+
|
|
88
|
+
### Using uv (Recommended)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Clone the repository
|
|
92
|
+
git clone <repository-url>
|
|
93
|
+
cd py_vreport
|
|
94
|
+
|
|
95
|
+
# Install using uv
|
|
96
|
+
uv tool install .
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## ๐ Usage
|
|
100
|
+
|
|
101
|
+
After installation, you can use the `vreport` command directly from your terminal.
|
|
102
|
+
|
|
103
|
+
### ๐ Basic Summary
|
|
104
|
+
|
|
105
|
+
Get a high-level overview of one or more test reports:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
vreport summary path/to/report.xml
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Output includes:**
|
|
112
|
+
- Module name and file path
|
|
113
|
+
- Test start time
|
|
114
|
+
- Total number of tests
|
|
115
|
+
- Number of failures
|
|
116
|
+
- List of failed test titles
|
|
117
|
+
|
|
118
|
+
### โ Detailed Failure Analysis
|
|
119
|
+
|
|
120
|
+
See **why** tests failed, with context logs and diagnostic tables:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
vreport failures path/to/report.xml
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Features:**
|
|
127
|
+
- Complete failure messages
|
|
128
|
+
- Context logs (up to 5 most recent log entries before failure)
|
|
129
|
+
- Diagnostic data tables (UDS parameters, values, raw bytes)
|
|
130
|
+
- Color-coded output for easy scanning
|
|
131
|
+
|
|
132
|
+
### ๐ฌ Detailed Test Case Inspection
|
|
133
|
+
|
|
134
|
+
Inspect the full execution logs for specific test cases by searching with a term:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
vreport inspect path/to/report.xml --test-case "Check_Door_Lock_Status"
|
|
138
|
+
|
|
139
|
+
# Using short flag
|
|
140
|
+
vreport inspect path/to/report.xml -t "DTC_Check"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Features:**
|
|
144
|
+
- Case-insensitive search
|
|
145
|
+
- Shows all matching test cases
|
|
146
|
+
- Complete step-by-step execution timeline
|
|
147
|
+
- Timestamps, results, and descriptions for each step
|
|
148
|
+
- Inline diagnostic data display
|
|
149
|
+
- Duration and verdict information
|
|
150
|
+
|
|
151
|
+
### ๐ Processing Multiple Files
|
|
152
|
+
|
|
153
|
+
Process multiple XML files in a single command:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Summary for multiple files
|
|
157
|
+
vreport summary report1.xml report2.xml report3.xml
|
|
158
|
+
|
|
159
|
+
# Failures across multiple reports
|
|
160
|
+
vreport failures tests/*.xml
|
|
161
|
+
|
|
162
|
+
# Inspect across multiple files
|
|
163
|
+
vreport inspect module1.xml module2.xml -t "Voltage_Check"
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## ๐ Command Reference
|
|
167
|
+
|
|
168
|
+
### `vreport summary`
|
|
169
|
+
|
|
170
|
+
Display high-level summary of test results.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
vreport summary [FILES...]
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Arguments:**
|
|
177
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
178
|
+
|
|
179
|
+
### `vreport failures`
|
|
180
|
+
|
|
181
|
+
Show detailed failure information with context and diagnostics.
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
vreport failures [FILES...]
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Arguments:**
|
|
188
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
189
|
+
|
|
190
|
+
### `vreport inspect`
|
|
191
|
+
|
|
192
|
+
Inspect detailed logs for specific test cases.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
vreport inspect [FILES...] --test-case SEARCH_TERM
|
|
196
|
+
vreport inspect [FILES...] -t SEARCH_TERM
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Arguments:**
|
|
200
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
201
|
+
|
|
202
|
+
**Options:**
|
|
203
|
+
- `-t, --test-case TEXT`: Search term for test case title (case-insensitive) **[required]**
|
|
204
|
+
|
|
205
|
+
## ๐ Project Structure
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
py_vreport/
|
|
209
|
+
โโโ src/
|
|
210
|
+
โ โโโ py_vreport/
|
|
211
|
+
โ โโโ __init__.py # Package exports
|
|
212
|
+
โ โโโ models.py # Data models (TestModule, TestCase, etc.)
|
|
213
|
+
โ โโโ parser.py # Pure parsing logic (library)
|
|
214
|
+
โ โโโ cli.py # Typer CLI implementation
|
|
215
|
+
โ โโโ formatters.py # Rich formatting for terminal output
|
|
216
|
+
โโโ tests/ # Unit tests
|
|
217
|
+
โโโ pyproject.toml # Project configuration
|
|
218
|
+
โโโ README.md # This file
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Architecture
|
|
222
|
+
|
|
223
|
+
**Separation of Concerns:**
|
|
224
|
+
- **`models.py`**: Dataclasses defining the report structure (TestModule, TestGroup, TestCase, TestStep, FailureContext)
|
|
225
|
+
- **`parser.py`**: Pure library logic for parsing XMLโcan be imported and used programmatically
|
|
226
|
+
- **`cli.py`**: Typer-based CLI commands and argument handling
|
|
227
|
+
- **`formatters.py`**: Rich formatting logic for beautiful terminal output (tables, panels, colors)
|
|
228
|
+
|
|
229
|
+
This clean separation allows `py_vreport` to be used both as a CLI tool and as a Python library in your own scripts.
|
|
230
|
+
|
|
231
|
+
## ๐ Programmatic Usage
|
|
232
|
+
|
|
233
|
+
You can also use py_vreport as a Python library:
|
|
234
|
+
|
|
235
|
+
```python
|
|
236
|
+
from py_vreport.parser import CanoeReportParser
|
|
237
|
+
|
|
238
|
+
# Parse a report
|
|
239
|
+
parser = CanoeReportParser("path/to/report.xml")
|
|
240
|
+
report = parser.parse()
|
|
241
|
+
|
|
242
|
+
# Access data
|
|
243
|
+
print(f"Module: {report.name}")
|
|
244
|
+
print(f"Total tests: {len(report.get_all_test_cases())}")
|
|
245
|
+
|
|
246
|
+
# Get failures
|
|
247
|
+
failures = report.get_all_failures()
|
|
248
|
+
for failure in failures:
|
|
249
|
+
print(f"Failed: {failure.title}")
|
|
250
|
+
print(f"Reason: {failure.failure_reason}")
|
|
251
|
+
|
|
252
|
+
# Access rich failure context
|
|
253
|
+
for ctx in failure.rich_failure:
|
|
254
|
+
print(f"Context logs: {ctx.context_logs}")
|
|
255
|
+
print(f"Diagnostic data: {ctx.diagnostic_table}")
|
|
256
|
+
|
|
257
|
+
# Export to pandas DataFrame
|
|
258
|
+
df = report.to_pandas()
|
|
259
|
+
print(df.head())
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## ๐จ Output Examples
|
|
263
|
+
|
|
264
|
+
### Summary Output
|
|
265
|
+
```
|
|
266
|
+
โญโโโโโโโโโโโโโโโโโโโ Module: ECU_Tests โโโโโโโโโโโโโโโโโโโโโฎ
|
|
267
|
+
โ Property โ Value โ
|
|
268
|
+
โ File โ /path/to/report.xml โ
|
|
269
|
+
โ Start Time โ 2024-01-25T10:30:00 โ
|
|
270
|
+
โ Total Tests โ 45 โ
|
|
271
|
+
โ Failures โ 3 โ
|
|
272
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
273
|
+
|
|
274
|
+
Failed Tests:
|
|
275
|
+
โข Check_DTC_Status: Expected DTC 0x123456, got 0x000000
|
|
276
|
+
โข Voltage_Range_Check: Voltage out of range
|
|
277
|
+
โข Door_Lock_Response: Timeout waiting for response
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Failure Output
|
|
281
|
+
```
|
|
282
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
283
|
+
โ ECU_Tests - Found 3 failures โ
|
|
284
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
285
|
+
|
|
286
|
+
โ Check_DTC_Status
|
|
287
|
+
Expected DTC 0x123456, got 0x000000
|
|
288
|
+
|
|
289
|
+
Context:
|
|
290
|
+
- I-001: Sending diagnostic session control
|
|
291
|
+
- I-002: Session changed to extended
|
|
292
|
+
- I-003: Reading DTC memory
|
|
293
|
+
- I-004: DTC request: 19 02 FF
|
|
294
|
+
- I-005: Expected response: 59 02 01 23 45 67
|
|
295
|
+
|
|
296
|
+
โโโโโโโโโโโโ Diagnostic Data โโโโโโโโโโโ
|
|
297
|
+
โ Parameter โ Value โ Raw โ
|
|
298
|
+
โ Request โ 19 02 FF โ 0x1902FF โ
|
|
299
|
+
โ Response โ 59 02 00 โ 0x590200 โ
|
|
300
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
301
|
+
|
|
302
|
+
โญโโโโโโโโโโโโโโโ ERROR โโโโโโโโโโโโโโโโโฎ
|
|
303
|
+
โ Expected DTC 0x123456, got 0x000000 โ
|
|
304
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
305
|
+
```
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# py_vreport
|
|
2
|
+
|
|
3
|
+
**py_vreport** is a modern Python tool designed to parse, analyze, and summarize **Vector CANoe XML Test Reports**.
|
|
4
|
+
|
|
5
|
+
It provides a powerful command-line interface (CLI) using Typer and Rich to quickly extract test results, identify failures, and view detailed diagnostic contextโall from your terminal, without needing to open the full HTML/XML report in a browser.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## โจ Features
|
|
10
|
+
|
|
11
|
+
- **๐ Fast Parsing**: Efficiently parses large CANoe XML report files
|
|
12
|
+
- **๐ Summary Views**: Get quick overviews of test modules, total tests, and pass/fail counts
|
|
13
|
+
- **๐ Detailed Failure Analysis**:
|
|
14
|
+
- View failure context (logs leading up to the failure)
|
|
15
|
+
- Inspect diagnostic data (UDS requests/responses) associated with failures
|
|
16
|
+
- See exactly where and why tests failed
|
|
17
|
+
- **๐ฌ Detailed Test Case Inspection**: View every test step, its result, and associated diagnostic data for specific test cases
|
|
18
|
+
- **๐ Multi-file Support**: Process multiple report files in a single batch operation
|
|
19
|
+
- **๐จ Rich Terminal Output**: Beautifully formatted output with colors, tables, and panels powered by Rich
|
|
20
|
+
- **๐ฆ Clean Architecture**: Separated parser library from CLI for programmatic use
|
|
21
|
+
- **๐ค AI-Agent Integration**: Designed to work seamlessly with AI agents (like Gemini CLI). You can pipe report data directly into an LLM to:
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## ๐ Requirements
|
|
25
|
+
|
|
26
|
+
- **Python 3.11+**
|
|
27
|
+
- Dependencies managed via `uv` (recommended) or `pip`
|
|
28
|
+
|
|
29
|
+
## ๐ง Installation
|
|
30
|
+
|
|
31
|
+
### Using uv (Recommended)
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Clone the repository
|
|
35
|
+
git clone <repository-url>
|
|
36
|
+
cd py_vreport
|
|
37
|
+
|
|
38
|
+
# Install using uv
|
|
39
|
+
uv tool install .
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## ๐ Usage
|
|
43
|
+
|
|
44
|
+
After installation, you can use the `vreport` command directly from your terminal.
|
|
45
|
+
|
|
46
|
+
### ๐ Basic Summary
|
|
47
|
+
|
|
48
|
+
Get a high-level overview of one or more test reports:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
vreport summary path/to/report.xml
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Output includes:**
|
|
55
|
+
- Module name and file path
|
|
56
|
+
- Test start time
|
|
57
|
+
- Total number of tests
|
|
58
|
+
- Number of failures
|
|
59
|
+
- List of failed test titles
|
|
60
|
+
|
|
61
|
+
### โ Detailed Failure Analysis
|
|
62
|
+
|
|
63
|
+
See **why** tests failed, with context logs and diagnostic tables:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
vreport failures path/to/report.xml
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Features:**
|
|
70
|
+
- Complete failure messages
|
|
71
|
+
- Context logs (up to 5 most recent log entries before failure)
|
|
72
|
+
- Diagnostic data tables (UDS parameters, values, raw bytes)
|
|
73
|
+
- Color-coded output for easy scanning
|
|
74
|
+
|
|
75
|
+
### ๐ฌ Detailed Test Case Inspection
|
|
76
|
+
|
|
77
|
+
Inspect the full execution logs for specific test cases by searching with a term:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
vreport inspect path/to/report.xml --test-case "Check_Door_Lock_Status"
|
|
81
|
+
|
|
82
|
+
# Using short flag
|
|
83
|
+
vreport inspect path/to/report.xml -t "DTC_Check"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Features:**
|
|
87
|
+
- Case-insensitive search
|
|
88
|
+
- Shows all matching test cases
|
|
89
|
+
- Complete step-by-step execution timeline
|
|
90
|
+
- Timestamps, results, and descriptions for each step
|
|
91
|
+
- Inline diagnostic data display
|
|
92
|
+
- Duration and verdict information
|
|
93
|
+
|
|
94
|
+
### ๐ Processing Multiple Files
|
|
95
|
+
|
|
96
|
+
Process multiple XML files in a single command:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Summary for multiple files
|
|
100
|
+
vreport summary report1.xml report2.xml report3.xml
|
|
101
|
+
|
|
102
|
+
# Failures across multiple reports
|
|
103
|
+
vreport failures tests/*.xml
|
|
104
|
+
|
|
105
|
+
# Inspect across multiple files
|
|
106
|
+
vreport inspect module1.xml module2.xml -t "Voltage_Check"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## ๐ Command Reference
|
|
110
|
+
|
|
111
|
+
### `vreport summary`
|
|
112
|
+
|
|
113
|
+
Display high-level summary of test results.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
vreport summary [FILES...]
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Arguments:**
|
|
120
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
121
|
+
|
|
122
|
+
### `vreport failures`
|
|
123
|
+
|
|
124
|
+
Show detailed failure information with context and diagnostics.
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
vreport failures [FILES...]
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Arguments:**
|
|
131
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
132
|
+
|
|
133
|
+
### `vreport inspect`
|
|
134
|
+
|
|
135
|
+
Inspect detailed logs for specific test cases.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
vreport inspect [FILES...] --test-case SEARCH_TERM
|
|
139
|
+
vreport inspect [FILES...] -t SEARCH_TERM
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Arguments:**
|
|
143
|
+
- `FILES`: One or more paths to CANoe XML report files
|
|
144
|
+
|
|
145
|
+
**Options:**
|
|
146
|
+
- `-t, --test-case TEXT`: Search term for test case title (case-insensitive) **[required]**
|
|
147
|
+
|
|
148
|
+
## ๐ Project Structure
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
py_vreport/
|
|
152
|
+
โโโ src/
|
|
153
|
+
โ โโโ py_vreport/
|
|
154
|
+
โ โโโ __init__.py # Package exports
|
|
155
|
+
โ โโโ models.py # Data models (TestModule, TestCase, etc.)
|
|
156
|
+
โ โโโ parser.py # Pure parsing logic (library)
|
|
157
|
+
โ โโโ cli.py # Typer CLI implementation
|
|
158
|
+
โ โโโ formatters.py # Rich formatting for terminal output
|
|
159
|
+
โโโ tests/ # Unit tests
|
|
160
|
+
โโโ pyproject.toml # Project configuration
|
|
161
|
+
โโโ README.md # This file
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Architecture
|
|
165
|
+
|
|
166
|
+
**Separation of Concerns:**
|
|
167
|
+
- **`models.py`**: Dataclasses defining the report structure (TestModule, TestGroup, TestCase, TestStep, FailureContext)
|
|
168
|
+
- **`parser.py`**: Pure library logic for parsing XMLโcan be imported and used programmatically
|
|
169
|
+
- **`cli.py`**: Typer-based CLI commands and argument handling
|
|
170
|
+
- **`formatters.py`**: Rich formatting logic for beautiful terminal output (tables, panels, colors)
|
|
171
|
+
|
|
172
|
+
This clean separation allows `py_vreport` to be used both as a CLI tool and as a Python library in your own scripts.
|
|
173
|
+
|
|
174
|
+
## ๐ Programmatic Usage
|
|
175
|
+
|
|
176
|
+
You can also use py_vreport as a Python library:
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
from py_vreport.parser import CanoeReportParser
|
|
180
|
+
|
|
181
|
+
# Parse a report
|
|
182
|
+
parser = CanoeReportParser("path/to/report.xml")
|
|
183
|
+
report = parser.parse()
|
|
184
|
+
|
|
185
|
+
# Access data
|
|
186
|
+
print(f"Module: {report.name}")
|
|
187
|
+
print(f"Total tests: {len(report.get_all_test_cases())}")
|
|
188
|
+
|
|
189
|
+
# Get failures
|
|
190
|
+
failures = report.get_all_failures()
|
|
191
|
+
for failure in failures:
|
|
192
|
+
print(f"Failed: {failure.title}")
|
|
193
|
+
print(f"Reason: {failure.failure_reason}")
|
|
194
|
+
|
|
195
|
+
# Access rich failure context
|
|
196
|
+
for ctx in failure.rich_failure:
|
|
197
|
+
print(f"Context logs: {ctx.context_logs}")
|
|
198
|
+
print(f"Diagnostic data: {ctx.diagnostic_table}")
|
|
199
|
+
|
|
200
|
+
# Export to pandas DataFrame
|
|
201
|
+
df = report.to_pandas()
|
|
202
|
+
print(df.head())
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## ๐จ Output Examples
|
|
206
|
+
|
|
207
|
+
### Summary Output
|
|
208
|
+
```
|
|
209
|
+
โญโโโโโโโโโโโโโโโโโโโ Module: ECU_Tests โโโโโโโโโโโโโโโโโโโโโฎ
|
|
210
|
+
โ Property โ Value โ
|
|
211
|
+
โ File โ /path/to/report.xml โ
|
|
212
|
+
โ Start Time โ 2024-01-25T10:30:00 โ
|
|
213
|
+
โ Total Tests โ 45 โ
|
|
214
|
+
โ Failures โ 3 โ
|
|
215
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
216
|
+
|
|
217
|
+
Failed Tests:
|
|
218
|
+
โข Check_DTC_Status: Expected DTC 0x123456, got 0x000000
|
|
219
|
+
โข Voltage_Range_Check: Voltage out of range
|
|
220
|
+
โข Door_Lock_Response: Timeout waiting for response
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Failure Output
|
|
224
|
+
```
|
|
225
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
226
|
+
โ ECU_Tests - Found 3 failures โ
|
|
227
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
228
|
+
|
|
229
|
+
โ Check_DTC_Status
|
|
230
|
+
Expected DTC 0x123456, got 0x000000
|
|
231
|
+
|
|
232
|
+
Context:
|
|
233
|
+
- I-001: Sending diagnostic session control
|
|
234
|
+
- I-002: Session changed to extended
|
|
235
|
+
- I-003: Reading DTC memory
|
|
236
|
+
- I-004: DTC request: 19 02 FF
|
|
237
|
+
- I-005: Expected response: 59 02 01 23 45 67
|
|
238
|
+
|
|
239
|
+
โโโโโโโโโโโโ Diagnostic Data โโโโโโโโโโโ
|
|
240
|
+
โ Parameter โ Value โ Raw โ
|
|
241
|
+
โ Request โ 19 02 FF โ 0x1902FF โ
|
|
242
|
+
โ Response โ 59 02 00 โ 0x590200 โ
|
|
243
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
244
|
+
|
|
245
|
+
โญโโโโโโโโโโโโโโโ ERROR โโโโโโโโโโโโโโโโโฎ
|
|
246
|
+
โ Expected DTC 0x123456, got 0x000000 โ
|
|
247
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
248
|
+
```
|
|
Binary file
|