Skip to content

Commit

Permalink
more testing
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Nov 14, 2024
1 parent ee618f7 commit a759c26
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/functional/microbatch/test_microbatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def test_run_with_event_time_logs(self, project):
"""


class TestMicrobatchIncrementalPartitionFailure(BaseMicrobatchTest):
class TestMicrobatchIncrementalBatchFailure(BaseMicrobatchTest):
@pytest.fixture(scope="class")
def models(self):
return {
Expand All @@ -531,11 +531,11 @@ def test_run_with_event_time(self, project):
GenericExceptionOnRun, predicate=lambda event: event.data.node_info is not None
)

# run all partitions from start - 2 expected rows in output, one failed
with patch_microbatch_end_time("2020-01-03 13:57:00"):
run_dbt(["run"], callbacks=[event_catcher.catch], expect_pass=False)

assert len(event_catcher.caught_events) == 1
# run all partitions from start - 2 expected rows in output, one failed
self.assert_row_count(project, "microbatch_model", 2)

run_results = get_artifact(project.project_root, "target", "run_results.json")
Expand Down Expand Up @@ -633,7 +633,7 @@ def test_run_with_event_time(self, project):
"""


class TestMicrobatchInitialPartitionFailure(BaseMicrobatchTest):
class TestMicrobatchInitialBatchFailure(BaseMicrobatchTest):
@pytest.fixture(scope="class")
def models(self):
return {
Expand All @@ -642,9 +642,14 @@ def models(self):
}

def test_run_with_event_time(self, project):
event_catcher = EventCatcher(
GenericExceptionOnRun, predicate=lambda event: event.data.node_info is not None
)

# run all partitions from start - 2 expected rows in output, one failed
with patch_microbatch_end_time("2020-01-03 13:57:00"):
run_dbt(["run"])
run_dbt(["run"], callbacks=[event_catcher.catch])
assert len(event_catcher.caught_events) == 1
self.assert_row_count(project, "microbatch_model", 2)


Expand Down

0 comments on commit a759c26

Please sign in to comment.