|
1 | 1 | # type: ignore |
| 2 | +import typing as t |
2 | 3 | import os |
3 | 4 | import pathlib |
4 | 5 | from unittest import mock |
|
17 | 18 | BotCommand, |
18 | 19 | MergeStateStatus, |
19 | 20 | ) |
| 21 | +from sqlmesh.integrations.github.cicd.controller import GithubController |
20 | 22 | from sqlmesh.integrations.github.cicd.command import _update_pr_environment |
21 | 23 | from sqlmesh.utils.date import to_datetime, now |
22 | 24 | from tests.integrations.github.cicd.conftest import MockIssueComment |
@@ -591,3 +593,39 @@ def test_uncategorized( |
591 | 593 | assert "The following models could not be categorized automatically" in summary |
592 | 594 | assert '- "b"' in summary |
593 | 595 | assert "Run `sqlmesh plan hello_world_2` locally to apply these changes" in summary |
| 596 | + |
| 597 | + |
| 598 | +def test_get_plan_summary_doesnt_truncate_backfill_list( |
| 599 | + github_client, make_controller: t.Callable[..., GithubController] |
| 600 | +): |
| 601 | + controller = make_controller( |
| 602 | + "tests/fixtures/github/pull_request_synchronized.json", |
| 603 | + github_client, |
| 604 | + mock_out_context=False, |
| 605 | + ) |
| 606 | + |
| 607 | + summary = controller.get_plan_summary(controller.prod_plan) |
| 608 | + |
| 609 | + assert "more ...." not in summary |
| 610 | + |
| 611 | + assert ( |
| 612 | + """**Models needing backfill:** |
| 613 | +* `memory.raw.demographics`: [full refresh] |
| 614 | +* `memory.sushi.active_customers`: [full refresh] |
| 615 | +* `memory.sushi.count_customers_active`: [full refresh] |
| 616 | +* `memory.sushi.count_customers_inactive`: [full refresh] |
| 617 | +* `memory.sushi.customer_revenue_by_day`: [2025-06-30 - 2025-07-06] |
| 618 | +* `memory.sushi.customer_revenue_lifetime`: [2025-06-30 - 2025-07-06] |
| 619 | +* `memory.sushi.customers`: [full refresh] |
| 620 | +* `memory.sushi.items`: [2025-06-30 - 2025-07-06] |
| 621 | +* `memory.sushi.latest_order`: [full refresh] |
| 622 | +* `memory.sushi.marketing`: [2025-06-30 - 2025-07-06] |
| 623 | +* `memory.sushi.order_items`: [2025-06-30 - 2025-07-06] |
| 624 | +* `memory.sushi.orders`: [2025-06-30 - 2025-07-06] |
| 625 | +* `memory.sushi.raw_marketing`: [full refresh] |
| 626 | +* `memory.sushi.top_waiters`: [recreate view] |
| 627 | +* `memory.sushi.waiter_as_customer_by_day`: [2025-06-30 - 2025-07-06] |
| 628 | +* `memory.sushi.waiter_names`: [full refresh] |
| 629 | +* `memory.sushi.waiter_revenue_by_day`: [2025-06-30 - 2025-07-06]""" |
| 630 | + in summary |
| 631 | + ) |
0 commit comments