Skip to content

[CT-2997] Ability to test incremental models #8422

@gshank

Description

@gshank

Description

We should allow folks to add unit tests to incremental models

Acceptance criteria

  • Ability to test incremental models in both full refresh and incremental mode
  • Ability to specify the current status of an incremental model to test the incremental behavior

More on the above two points in #8275 (reply in thread):

To support this, dbt's unit testing framework would need to provide the ability to:

  • override the is_incremental macro to return True (p0), and provide the ability to specify an input fixture for {{ this }} (p1) in order to mock out the previous state of an incremental model. The expect output would be the set of rows that dbt's incremental materialization would insert/merge into the existing relation in production, as opposed to the resulting updated representation of the model.

To be moved into a separate issue:

A "current_actual" could define the current state of the model we're incrementing on, testing whether the incrementing works as expected.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions