Skip to content

Zelos Config Plugin for pytest

The Zelos Config plugin manages common configuration for all Zelos pytest plugins, providing centralized artifact directory management and naming conventions.

Installation

The plugin is part of the zelos_sdk package and is automatically included when using:

pytest_plugins = ["zelos_sdk.pytest.plugins"]

Command Line Options

Option Description Default
--zelos-local-artifacts-dir DIR Local artifacts output directory None
--zelos-artifact-basename FORMAT Artifact basename format {date:%Y%m%d-%H%M%S}-zelos

Usage

Basic Usage

# Set artifacts directory
pytest --zelos-local-artifacts-dir=./test_results

# Custom artifact naming
pytest --zelos-artifact-basename="mytest-{date:%Y%m%d}"

Configuration File

# pytest.ini
[pytest]
addopts = --zelos-local-artifacts-dir=./artifacts
          --zelos-artifact-basename="{date:%Y%m%d-%H%M%S}-test"

Features

  • Artifact Directory Management: Automatically creates the specified artifacts directory
  • Shared Configuration: Provides common configuration that other Zelos plugins can use
  • Custom Hook Support: Defines the pytest_zelos_configure hook for plugin coordination
  • Timestamp-based Naming: Supports date/time formatting in artifact names

Integration

Other Zelos plugins automatically use the configuration provided by this plugin:

  • Trace Plugin: Uses the artifacts directory for trace file output
  • Report Plugin: Uses the artifacts directory and basename for HTML reports
  • Checker Plugin: Uses the artifacts directory for checker output files

The config plugin ensures all artifacts are organized in a consistent location with predictable naming.