Skip to main content

dbt-allure: Elevate dbt testing with intuitive Allure reports, streamlining data validation and transformation projects.

Project description

dbt-allure

Enhance your dbt testing with the dbt-allure plugin. It transforms dbt test results into detailed Allure reports, giving clear insights into your data transformations. Perfect for ensuring data integrity, this plugin makes test outcomes easy to understand and act upon. Dive deeper into testing with dbt by checking the dbt testing documentation.

For more information on Allure, visit Allure Framework. To learn more about dbt and how it works, visit the official dbt documentation.

Installation

Ensure you install the dbt-allure plugin with the same Python interpreter used by your dbt-core. The plugin can be installed via pip, poetry, or directly from a Git repository:

  • Using pip

    pip install dbt-allure
    
  • Using Poetry

    poetry add dbt-allure
    

Usage

Running dbt Commands to Generate Allure Test Results

The dbt-allure plugin can be utilized through programmatic invocations in Python or by using the provided dbt CLI wrapper.

Programmatic Invocation:

For more detailed information on programmatic invocation with dbt, refer to the dbt documentation on running dbt programmatically.

from dbt_allure import allure_callback
from dbt.cli.main import dbtRunner

dbt = dbtRunner(
  callbacks=[
    allure_callback,
  ]
)
dbt.invoke("test")

CLI Wrapper (Bash):

python -m dbt_allure test 

Generating Allure Test Reports

To visualize your test results with Allure, generate and open the Allure report:

export TEST_RESULTS_DIR=target/allure-results
export TEST_REPORT_DIR=target/allure-report
allure generate $TEST_RESULTS_DIR -o $TEST_REPORT_DIR --clean
allure open $TEST_REPORT_DIR

Plugin Configuration

The default configuration file for the plugin is .dbt_allure.yml, which can be overridden by the environment variable DBT_ALLURE_CONFIG_PATH.

Configuration options

  • results_dir_path: The path where Allure results will be stored.
  • clean_results: A boolean flag to clean results_dir_path before a run. Note: When using programmatic invocation, cleanup occurs only upon importing the callback. It's recommended to set this to False and manage cleanup manually for programmatic usage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbt_allure-0.0.1b2.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

dbt_allure-0.0.1b2-py3-none-any.whl (17.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page