On this page

Test reporting configuration

File: lhp.yaml. Path: test_reporting. Omit the block to generate without a reporting provider. See Report test results to an external system for a complete provider example.

test_reporting:
  module_path: providers/audit_delta.py
  function_name: publish_results
  config_file: providers/audit_config.yaml

Fields

Field

Type

Required / default

Meaning

module_path

string

Required

Project-relative provider Python file, copied into the generated pipeline.

function_name

string

Required

Callable exported by the module.

config_file

string or null

unset

Optional provider configuration file. The resulting configuration is passed to the provider; without it, the provider receives an empty mapping.

The optional provider configuration is copied into the generated hook. Tokens inside that file are passed through unresolved; resolve them in your provider or supply concrete values.

Provider contract

The hook calls the function with keyword arguments:

def publish_results(results, config, context, spark):
    # Publish the collected results using your chosen destination.
    return {"published": len(results), "failed": 0}

results contains the collected test results. config is the provider’s configuration mapping. context includes pipeline_id, update_id, pipeline_name and terminal_state. spark is the active Spark session. The returned mapping’s published and failed counts are logged. Provider exceptions are caught and reported by the hook.

Generate with --include-tests. Assign test_id on individual test actions to correlate results. Use on_violation: warn for tests whose metrics must reach the reporting hook; a failing flow can stop before its metrics are recorded.

A non-mapping block or missing provider fields produces LHP-CFG-009 with a test-reporting-specific title. Diagnose using the title and details as well as the code.