Qase-Pytest Metrics Exporter
This project leverages the qase-pytest plugin to extract test result data, convert it into metrics, and push it to Victoria Metrics.
Features
- Collects test execution results using
qase-pytest - Formats results into metrics
- Pushes the metrics to Victoria Metrics for monitoring and visualization
Environment Variables
Before running the tests, set up the following environment variables:
| Variable Name | Description | Required |
|---|---|---|
VICTORIA_URL |
URL of the Victoria Metrics instance | Yes |
QASE_TESTOPS_RUN_ID |
Qase TestOps Run ID | Yes |
QASE_TESTOPS_PROJECT |
Qase project identifier | Yes |
PLATFORM |
Platform identifier (e.g., OS, environment) | Yes |
QASE_TESTOPS_API_TOKEN |
API token for Qase integration | Yes |
QASE_ADMIN_TOKEN |
API token for Qase data changes integration | Yes |
EXCLUDED_RUN_ID |
Run ID to exclude from metrics | Yes |
PUSH_TO_VICTORIA |
Option to Push or Not Push the Result | Yes |
MULTIPLE_REPORT |
Option to generate multiple report for multiple job | Yes |
DELETE_TEMP_FILE |
Option to delete report per worker after execution | Yes |
PILLAR |
Pillar for worker report preffix name | Yes |
Usage
On a testcase level, import this decators
from pytest_metrics.decorators import qase_id, qase_title, qase_suite, qase_tags
To apply the decorators , follow this example :
@qase_id(5189)
@qase_title("User success login, when input email, password, and gauth valid")
@qase_suite("PRO WEB.AUTH.LOGIN")
@qase_tags("ProSpot")
def test_1():
var = False
assert_that(var).is_true()
To exclude test case from being pushed to Excluded Run Id, follow this example :
@qase_ignore()
Modify your conftest.py file to integrate with the metrics reporting system:
from pytest_metrics.metrics import MetricsReport
import os
qase_report = MetricsReport()
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
outcome = yield
rep = outcome.get_result()
if call.when == "call":
qase_report.collect_result(item, rep)
item.test_result = rep
def pytest_sessionfinish(session, exitstatus):
worker_id = os.environ.get("PYTEST_XDIST_WORKER")
if worker_id:
qase_report.save_to_temp_file(worker_id)
else:
qase_report.load_and_merge_results()
qase_report.send_to_victoria_metrics()
Installation
- Install dependencies:
pip install qase-victoria-metrics
-
Set up the required environment variables.
-
Run your tests:
pytest /path/to/file
How It Works
- During test execution, pytest_runtest_makereport collects test results.
- After the test session, results are either saved (for distributed runs) or aggregated.
- The final results are pushed to Victoria Metrics for monitoring.
Metadata
Release files for qase-victoria-metrics 1.2.7
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 |
|---|---|---|---|---|
| qase_victoria_metrics-1.2.7.tar.gz | 9.7 kB | With provenance | Details for qase_victoria_metrics-1.2.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qase_victoria_metrics-1.2.7-py3-none-any.whl | Python 3 | none | any | Details for qase_victoria_metrics-1.2.7-py3-none-any.whl |
Total release size: 18.6 kB
Release files / qase_victoria_metrics-1.2.7.tar.gz
| Download URL | qase_victoria_metrics-1.2.7.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ecdcea9a3a75c31e40d594c0341e6953254c1b63ed107221276b0b9c318d57d
|
|
BLAKE2b-256 checksum How to use checksums |
c9a9acd7713e9453662e5156eabcae78cdd1ae8cdf8c7da86bb59652ac92deee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logRelease files / qase_victoria_metrics-1.2.7-py3-none-any.whl
| Download URL | qase_victoria_metrics-1.2.7-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b57421fe4e543b65fc7e7bfd47d9db04693c439573f6569dca31ca91564406c8
|
|
BLAKE2b-256 checksum How to use checksums |
8cf52ccd44b797830a180bd3a046584c4ea1a9f5bab35ea62d4a29eeb299868e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logSecurity for qase-victoria-metrics 1.2.7
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for qase_victoria_metrics-1.2.7.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 3, 2026.
Transparency logA 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.