Horreum API Integration Script for Performance Test#160
Merged
jhutar merged 1 commit intoSep 30, 2025
Conversation
Contributor
|
Nice @yogananth-subramanian ! Could you please fix linting issues? |
fe710ba to
ffc40c7
Compare
fb6a1f3 to
c82f957
Compare
Contributor
|
Thank you Yogi! |
jhutar
approved these changes
Sep 30, 2025
…performance monitoring. It uses configuration-driven field definitions from horreum_fields_config.yaml and creates labels, change detection variables, and proper grouping for performance regression monitoring.
Horreum API Integration Script for Performance Test
This script creates a comprehensive Horreum test and schema setup for performance monitoring.
It uses configuration-driven field definitions from a YAML configuration file and creates labels,
change detection variables, and proper grouping for performance regression monitoring.
Features:
- Loads field definitions from configurable YAML file (default: horreum_fields_config.yaml)
- Creates Horreum test and schema from configuration
- Creates labels with intelligent naming (camelCase + __ prefix)
- Creates change detection variables with smart grouping
- Prevents duplicate labels and variables
- Optional cleanup of obsolete labels and variables
- Dry-run mode for safe preview of all operations including cleanup
- Provides detailed status reporting
- Fully automated operation (no user prompts)
- Flexible configuration file input via command line or environment variable
Authentication:
API Key (Recommended):
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
Token (Legacy):
export HORREUM_TOKEN="your-bearer-token"
Configuration:
Test and schema definitions are loaded from a YAML configuration file:
- test: Test configuration (name, owner, description, etc.)
- schema: Schema configuration (name, URI, owner, etc.)
- fields: Field definitions with change detection settings
Default configuration file: horreum_fields_config.yaml
Environment Variables:
Required:
HORREUM_URL - Horreum instance URL
HORREUM_API_KEY - API key for authentication
Optional:
HORREUM_CONFIG_FILE - Path to configuration file (default: horreum_fields_config.yaml)
HORREUM_SCHEMA_ID - Use existing schema ID (skip creation)
HORREUM_TEST_ID - Use existing test ID (skip creation)
SKIP_LABELS=true - Skip label creation
CLEANUP_LABELS=false - Disable removal of obsolete labels (default: enabled)
CLEANUP_VARIABLES=false - Disable removal of obsolete variables (default: enabled)
DRY_RUN=false - Execute changes (default: dry run enabled)
Command Line Arguments:
--config-file, -c - Path to configuration file (overrides HORREUM_CONFIG_FILE)
Usage:
# Basic usage (uses horreum_fields_config.yaml)
export HORREUM_URL="http://your-horreum-instance:8080"
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
python3 horreum_api_example.py
# Using custom config file via command line
python3 horreum_api_example.py --config-file my_config.yaml
# Using custom config file via environment variable
export HORREUM_CONFIG_FILE="my_config.yaml"
python3 horreum_api_example.py
# Execute changes (disable dry-run mode)
export DRY_RUN=false
python3 horreum_api_example.py
# Disable cleanup operations
export CLEANUP_LABELS=false
export CLEANUP_VARIABLES=false
python3 horreum_api_example.py
# Using existing resources
export HORREUM_SCHEMA_ID=285
export HORREUM_TEST_ID=399
python3 horreum_api_example.py
# Force execution without dry run (use with caution)
export DRY_RUN=false
python3 horreum_api_example.py
Assisted-by: AI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This script creates a comprehensive Horreum test and schema setup forperformance monitoring. It uses configuration-driven field definitions from horreum_fields_config.yaml and creates labels, change detection variables, and proper grouping for performance regression monitoring.
Features:
Authentication:
API Key (Recommended):
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
Configuration:
Test and schema definitions are loaded from horreum_fields_config.yaml:
- test: Test configuration (name, owner, description, etc.)
- schema: Schema configuration (name, URI, owner, etc.)
- fields: Field definitions with change detection settings
Environment Variables:
Required:
HORREUM_URL - Horreum instance URL
HORREUM_API_KEY - API key for authentication
Usage:
# Basic usage
export HORREUM_URL="http://your-horreum-instance:8080"
export HORREUM_API_KEY="HUSR_00000000_0000_0000_0000_000000000000"
python3 horreum_api.py
Assisted-by: AI