Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions tests/test_vendor/test_run_results_pre_v6.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@


def _module(version: int):
return importlib.import_module(
f"vendor.dbt_artifacts_parser.parsers.run_results.run_results_v{version}"
)
return importlib.import_module(f"vendor.dbt_artifacts_parser.parsers.run_results.run_results_v{version}")


def _result(status: str, unique_id: str) -> dict:
Expand Down Expand Up @@ -57,10 +55,7 @@ def test_reused_status_parses(self, version):
def test_known_statuses_preserve_value(self, version):
mod = _module(version)
for status in ("success", "error", "skipped"):
assert (
mod.RunResultOutput(**_result(status, "model.proj.a")).status.value
== status
)
assert mod.RunResultOutput(**_result(status, "model.proj.a")).status.value == status

def test_unknown_future_status_parses(self, version):
mod = _module(version)
Expand All @@ -71,20 +66,15 @@ def test_test_and_freshness_statuses_keep_their_value(self, version):
"""Test/freshness statuses must keep their `.value` (resolved via Status1/Status2)."""
mod = _module(version)
for status in ("pass", "fail", "warn", "runtime error"):
assert (
mod.RunResultOutput(**_result(status, "test.proj.t")).status.value
== status
)
assert mod.RunResultOutput(**_result(status, "test.proj.t")).status.value == status


@pytest.mark.parametrize("version", VERSIONS)
class TestParseRunResultsEntryPointPreV6:
"""The public `parse_run_results` must parse a full file containing `reused`."""

def test_file_with_reused_result_parses_fully(self, version):
run_results = parse_run_results(
_run_results(version, "success", "reused", "skipped", "pass", "error", "no-op")
)
run_results = parse_run_results(_run_results(version, "success", "reused", "skipped", "pass", "error", "no-op"))
# Previously this whole file was dropped because of the single `reused` row.
assert len(run_results.results) == 6
assert {r.status.value for r in run_results.results} == {
Expand Down
Loading