InvenTree Test Statistics Plugin
An InvenTree plugin for generating and viewing statistical test data.
Description
The Test Statistics plugin provides a panel for viewing statistical test data aggregated by test template. It displays pass/fail counts and percentages, supports date range filtering, and shows month-by-month breakdowns as bar charts.
Test statistics can be generated for a particular part, or for a selected build order.
| Context | Screenshot |
|---|---|
| Test for a part (including variants) |
Features
Panel Interface
The statistics panel provides:
- Date range selector — Filter results by month using start and end date pickers. Defaults to the past year.
- Include Variants toggle — Optionally include test results from variant parts in the statistics.
- Results table — Each row represents a single (enabled) test template and shows:
- Test name and description
- Total pass and fail counts, each with percentage of total runs
- Total number of test executions
- Monthly breakdown — Click to expand any row and view a stacked bar chart of pass/fail counts broken down month by month across the selected date range.
API
The plugin exposes a REST endpoint at plugin/test_statistics/statistics/ that accepts the following query parameters:
| Parameter | Type | Description |
|---|---|---|
part |
integer | Filter by Part (primary key) |
include_variants |
boolean | Include variant parts in results (default: false) |
build |
integer | Filter by Build Order (primary key) |
stock_item |
integer | Filter by Stock Item (primary key) |
date_after |
date | Include results on or after this date |
date_before |
date | Include results on or before this date |
started_after |
datetime | Include results where test started on or after this datetime |
started_before |
datetime | Include results where test started on or before this datetime |
finished_after |
datetime | Include results where test finished on or after this datetime |
finished_before |
datetime | Include results where test finished on or before this datetime |
Only test templates with enabled=True are included in the response.
Response Format
The endpoint returns a list of objects, one per test template:
[
{
"template": 1,
"template_detail": {
"test_name": "Voltage Test",
"description": "..."
},
"pass_count": 42,
"fail_count": 3,
"monthly": [
{ "month": "2024-01-01", "pass_count": 10, "fail_count": 1 },
{ "month": "2024-02-01", "pass_count": 32, "fail_count": 2 }
]
}
]
Installation
Via User Interface
The simplest way to install this plugin is from the InvenTree plugin interface. Enter the plugin name (inventree-test-statistics) and click the Install button:
Via Pip
Alternatively, the plugin can be installed manually from the command line via pip:
pip install -U inventree-test-statistics
Note: After the plugin is installed, it must be activated via the InvenTree plugin interface.
Contributing
Backend
Backend code is written in Python, and is located in the test_statistics directory.
Frontend
Frontend code is written in TypeScript, and is located in the frontend directory. Read the frontend README for more information.
Metadata
Release files for inventree-test-statistics 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| inventree_test_statistics-0.3.1.tar.gz | 443.2 kB | Without provenance | Details for inventree_test_statistics-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| inventree_test_statistics-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for inventree_test_statistics-0.3.1-py3-none-any.whl |
Total release size: 891.4 kB
Release files / inventree_test_statistics-0.3.1.tar.gz
| Download URL | inventree_test_statistics-0.3.1.tar.gz |
|---|---|
| Size | 443.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
72cd15aa49232a236354bce931ce7e0047ad3c8bcca0ffb3cf8811c419e7e058
|
|
BLAKE2b-256 checksum How to use checksums |
797d602ac85de9995c2826c92fd5589ee8b55e5b6e4c308e9009d9cc0283e666
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / inventree_test_statistics-0.3.1-py3-none-any.whl
| Download URL | inventree_test_statistics-0.3.1-py3-none-any.whl |
|---|---|
| Size | 448.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c47a5c48c45453595d4ab62ddf3cb9fd264bc8e3d22355b82806e98cb5c9ec93
|
|
BLAKE2b-256 checksum How to use checksums |
151d112a90d31df2e6aa5f8970f1c85207a0d3a0581b841721fe632b4d8e580e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for inventree-test-statistics 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.