Skip to content

Conversation

@ivan-velasco
Copy link
Contributor

Configurable Failure Links Feature

Overview

The Configurable Failure Links feature enables Venom to automatically generate clickable links in test failure reports using values extracted from HTTP response headers. This saves QA and SDET engineers time by surfacing relevant external resources (e.g., trace dashboards, logs, issue trackers) directly in the failure output.

Features

  • Automatic link generation: Extract a configured response header value and inject it into a user-defined URL template when test assertions fail
  • Configurable: Support both YAML config and CLI flags for template and header key
  • Visibility: Present the link in CLI output, HTML/JSON reports

From Manual Link Construction

Before:

# Manual process
venom run tests.yml
# Copy header value from output
# Manually construct URL
# Open in browser

After:

# Automatic process
venom run --failure-link-header="X-Request-ID" \
          --failure-link-template="https://dashboard.example.com/trace/{{header}}" \
          tests.yml
# Click the generated link in output

YAML Configuration

Add the failure link configuration to your .venomrc file:

failure_link_header: "X-Request-ID"
failure_link_template: "https://dashboard.example.com/trace/{{header}}"

CLI Flags

Use command-line flags to configure failure links:

venom run --failure-link-header="X-Request-ID" --failure-link-template="https://dashboard.example.com/trace/{{header}}" tests.yml

Environment Variables

Set environment variables for configuration:

export FAILURE_LINK_HEADER="X-Request-ID"
export FAILURE_LINK_TEMPLATE="https://dashboard.example.com/trace/{{header}}"
venom run tests.yml

Advanced Template Usage

You can use the {{header}} placeholder in any part of your template, including:

  • URL parameters: https://example.com/search?q={{header}}
  • Query strings: query:(language:kuery,query:'requestId:%20{{header}}')
  • Path segments: https://logs.example.com/trace/{{header}}/details
  • Complex queries: https://kibana.example.com/app/discover#/?_a=(query:(language:kuery,query:'requestId:%20{{header}}'))

Potential future improvements:

  • Support for multiple header placeholders (e.g., {{header1}}, {{header2}})
  • Custom header value transformations
  • Integration with more external systems
  • Template validation at startup
  • Support for non-HTTP executors

ivan-velasco and others added 7 commits June 12, 2025 17:20
This reverts commit 3e3f43e, reversing
changes made to 044ac99.
- Introduced a new `FailureLink` field in `TestStepResult` to store failure links.
- Implemented logic to generate failure links when test steps fail, based on HTTP response headers.
- Updated output formats (XML and HTML) to include failure links for better traceability.
- Added configuration options for failure link header and template in command-line arguments and environment variables.

# Conflicts:
#	cmd/venom/run/cmd.go
#	venom.go
- Updated `printTestStepResult` method to include context as a parameter for better error handling.
- Enhanced failure link generation logic to differentiate between user and non-user executors.
- Introduced a new helper function to extract header values from various result formats.
- Adjusted HTML output to include a smaller button for viewing failure details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant