Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-3308] adjust dbt build to run in dag order -> unit tests, model materialization, data tests #8979

Closed
1 task done
Tracked by #8283
graciegoheen opened this issue Nov 1, 2023 · 1 comment · Fixed by #9108
Closed
1 task done
Tracked by #8283
Assignees
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation

Comments

@graciegoheen
Copy link
Contributor

graciegoheen commented Nov 1, 2023

Housekeeping

  • I am a maintainer of dbt-core

Short description

From #8651 and #8606

As per the above, move the unit testing functionality to the 'test' command and ensure that the build command runs unit tests.

Acceptance criteria

when dbt build is executed with unit tests, we will process the models according to their lineage / dependencies - executing the relevant tests in the following order:

  • unit tests on a model are run
  • model is materialized
  • data tests on a model are run

This is key for saving unnecessary warehouse spend, because we actually won’t materialize the model in the warehouse unless the unit tests pass successfully.

unit tests and data tests are types of tests that can be selected using --select test_type:unit or --select test_type:data for dbt build (same with --exclude)

Impact to Other Teams

none

Will backports be required?

No

Context

Follow up work to add exclusion capabilities once this issue is complete -> #8651

@graciegoheen graciegoheen added the user docs [docs.getdbt.com] Needs better documentation label Nov 1, 2023
@github-actions github-actions bot changed the title adjust dbt build to run in dag order -> unit tests, model materialization, data tests [CT-3308] adjust dbt build to run in dag order -> unit tests, model materialization, data tests Nov 1, 2023
@graciegoheen graciegoheen added the enhancement New feature or request label Nov 1, 2023
@martynydbt martynydbt assigned peterallenwebb and unassigned gshank Nov 7, 2023
@graciegoheen graciegoheen assigned gshank and unassigned peterallenwebb Nov 7, 2023
@graciegoheen
Copy link
Contributor Author

Outcome of flag spike:

  • unit tests and data tests are types of tests that can be selected using --select test_type:unit or --select test_type:data for dbt build (and dbt test)

We can include adding these new test types to the --select and --exclude flags to this ticket or a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request user docs [docs.getdbt.com] Needs better documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants