dbt-allure


Namedbt-allure JSON
Version 0.0.1b2 PyPI version JSON
download
home_page
Summarydbt-allure: Elevate dbt testing with intuitive Allure reports, streamlining data validation and transformation projects.
upload_time2024-02-23 19:08:16
maintainer
docs_urlNone
authorRoman
requires_python>=3.9
licenseGPL-3.0-only
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://docs.qameta.io/allure/). To learn more about dbt and how it works, visit the [official dbt documentation](https://docs.getdbt.com/docs/introduction).

## 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**
    ```bash
    pip install dbt-allure
    ```

- **Using Poetry**
    ```bash
    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](https://docs.getdbt.com/docs/running-a-dbt-project/running-dbt-in-python).

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

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

**CLI Wrapper (Bash):**


```bash
python -m dbt_allure test 
```
### Generating Allure Test Reports
To visualize your test results with Allure, generate and open the Allure report:

```bash
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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dbt-allure",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Roman",
    "author_email": "roman1001001@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a4/45/cb3f272dcfeade7bb9d69cc4888136a965d4614ee88d4ad8e055582bf104/dbt_allure-0.0.1b2.tar.gz",
    "platform": null,
    "description": "# dbt-allure\n\nEnhance 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.\n\nFor more information on Allure, visit [Allure Framework](https://docs.qameta.io/allure/). To learn more about dbt and how it works, visit the [official dbt documentation](https://docs.getdbt.com/docs/introduction).\n\n## Installation\n\nEnsure 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:\n\n- **Using pip**\n    ```bash\n    pip install dbt-allure\n    ```\n\n- **Using Poetry**\n    ```bash\n    poetry add dbt-allure\n    ```\n\n## Usage\n\n### Running dbt Commands to Generate Allure Test Results\n\nThe dbt-allure plugin can be utilized through programmatic invocations in Python or by using the provided dbt CLI wrapper.\n\n**Programmatic Invocation:**\n\nFor more detailed information on programmatic invocation with dbt, refer to the [dbt documentation on running dbt programmatically](https://docs.getdbt.com/docs/running-a-dbt-project/running-dbt-in-python).\n\n```python\nfrom dbt_allure import allure_callback\nfrom dbt.cli.main import dbtRunner\n\ndbt = dbtRunner(\n  callbacks=[\n    allure_callback,\n  ]\n)\ndbt.invoke(\"test\")\n```\n\n**CLI Wrapper (Bash):**\n\n\n```bash\npython -m dbt_allure test \n```\n### Generating Allure Test Reports\nTo visualize your test results with Allure, generate and open the Allure report:\n\n```bash\nexport TEST_RESULTS_DIR=target/allure-results\nexport TEST_REPORT_DIR=target/allure-report\nallure generate $TEST_RESULTS_DIR -o $TEST_REPORT_DIR --clean\nallure open $TEST_REPORT_DIR\n```\n\n### Plugin Configuration\nThe default configuration file for the plugin is .dbt_allure.yml, which can be overridden by the environment variable DBT_ALLURE_CONFIG_PATH.\n\n**Configuration options**\n* `results_dir_path`: The path where Allure results will be stored.\n* `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.\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "dbt-allure: Elevate dbt testing with intuitive Allure reports, streamlining data validation and transformation projects.",
    "version": "0.0.1b2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f35bc775b984506faf174c5c2fdd45761991f299b7cf6b2fb9e471e120ededc5",
                "md5": "6c018f966985b053c68b824439309b4a",
                "sha256": "eefad7902922c16bf73d7babad18a5d3ff16b6ad3cbbe4c0ee84a341bae46b2f"
            },
            "downloads": -1,
            "filename": "dbt_allure-0.0.1b2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c018f966985b053c68b824439309b4a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 17480,
            "upload_time": "2024-02-23T19:08:15",
            "upload_time_iso_8601": "2024-02-23T19:08:15.340305Z",
            "url": "https://files.pythonhosted.org/packages/f3/5b/c775b984506faf174c5c2fdd45761991f299b7cf6b2fb9e471e120ededc5/dbt_allure-0.0.1b2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a445cb3f272dcfeade7bb9d69cc4888136a965d4614ee88d4ad8e055582bf104",
                "md5": "ca29dc646784a149804b114ecaa2f864",
                "sha256": "38bd81412c55eb3ad909b5b31a47782579f1e9df964963999b018c984dfc9516"
            },
            "downloads": -1,
            "filename": "dbt_allure-0.0.1b2.tar.gz",
            "has_sig": false,
            "md5_digest": "ca29dc646784a149804b114ecaa2f864",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 16657,
            "upload_time": "2024-02-23T19:08:16",
            "upload_time_iso_8601": "2024-02-23T19:08:16.391915Z",
            "url": "https://files.pythonhosted.org/packages/a4/45/cb3f272dcfeade7bb9d69cc4888136a965d4614ee88d4ad8e055582bf104/dbt_allure-0.0.1b2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-23 19:08:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "dbt-allure"
}
        
Elapsed time: 0.25596s