mjirv / dbt-datamocktool

A dbt package for unit testing your SQL analytics models
Apache License 2.0
162 stars 20 forks source link

Feature support multiple test cases #54

Closed marcellovictorino closed 1 year ago

marcellovictorino commented 1 year ago

This is a:

Description & motivation

Addressing this issue, enables to define a test once, to be applied over multiple test cases.

Applicable when there are multiple test case scenarios, where the mocked input and expected output data (seed) represent a single case, having the seed file names identified by test_case_1, test_case_2 etc.

Checklist

Additional comments

  1. I am not sure what is the best way to adapt the proposed code change to the new dispatch pattern. I developed these changes against an old package version (v 0.1.2). I marked it with the comment {% FIXME: ...

  2. Also, I have changed the get_test macro behavior to always store the mocked model output as a view, which provides better visibility on failing tests. As a view, it is possible to inspect its definition, quickly debugging any issues

Note: this is my first time contributing to an open-source project 🎉! Please let me know if there is anything else I could/should do 👍

marcellovictorino commented 1 year ago

Forgot to tag you here for visibility: @mjirv

marcellovictorino commented 1 year ago

Thanks for the review @mjirv . I really appreciate it :) Been a busy week, but I will perform the required changes before the end of the week (2022-10-14)

marcellovictorino commented 1 year ago

Closing this in favor of splitting the different features into separate PRs: https://github.com/mjirv/dbt-datamocktool/pull/56