A Qase-Pytest plugin to extract test results and push metrics to Victoria Metrics
Project description
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 |
EXCLUDED_RUN_ID |
Run ID to exclude from metrics | Yes |
Usage
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qase_victoria_metrics-0.1.3.tar.gz.
File metadata
- Download URL: qase_victoria_metrics-0.1.3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b57b7d4459d79d5802f1b4aaaef1061f3332c563460fb1493eb0b33049a26d4f
|
|
| MD5 |
e22f5607fd031e997cbba62dd482ead0
|
|
| BLAKE2b-256 |
caf24da58f5158f1e2338d200c87ebca5bac05eea80898fe5c0e7f3464115be9
|
Provenance
The following attestation bundles were made for qase_victoria_metrics-0.1.3.tar.gz:
Publisher:
release.yml on dsetiawan230294/qase-victoria-metrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qase_victoria_metrics-0.1.3.tar.gz -
Subject digest:
b57b7d4459d79d5802f1b4aaaef1061f3332c563460fb1493eb0b33049a26d4f - Sigstore transparency entry: 183375027
- Sigstore integration time:
-
Permalink:
dsetiawan230294/qase-victoria-metrics@2166dc4758df56b07bb5cab0614f1b681084a612 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/dsetiawan230294
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2166dc4758df56b07bb5cab0614f1b681084a612 -
Trigger Event:
release
-
Statement type:
File details
Details for the file qase_victoria_metrics-0.1.3-py3-none-any.whl.
File metadata
- Download URL: qase_victoria_metrics-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdf2a806dfdf826af30fb71e04d6d2966656a307b3076ac963ac69ff70cdcbd3
|
|
| MD5 |
85fc1abfcdef96fe5a0abc9a52956b27
|
|
| BLAKE2b-256 |
a93c93bb2f790ee353afd83aece9a51eb9bc7d69362b6bf12ae471983834a610
|
Provenance
The following attestation bundles were made for qase_victoria_metrics-0.1.3-py3-none-any.whl:
Publisher:
release.yml on dsetiawan230294/qase-victoria-metrics
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qase_victoria_metrics-0.1.3-py3-none-any.whl -
Subject digest:
bdf2a806dfdf826af30fb71e04d6d2966656a307b3076ac963ac69ff70cdcbd3 - Sigstore transparency entry: 183375029
- Sigstore integration time:
-
Permalink:
dsetiawan230294/qase-victoria-metrics@2166dc4758df56b07bb5cab0614f1b681084a612 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/dsetiawan230294
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2166dc4758df56b07bb5cab0614f1b681084a612 -
Trigger Event:
release
-
Statement type: