Skip to content

Commit 5eaa09d

Browse files
committed
Fix GH tests
1 parent 6e26974 commit 5eaa09d

3 files changed

Lines changed: 35 additions & 25 deletions

File tree

sqlmesh/core/console.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,9 +2845,13 @@ def show_environment_difference_summary(
28452845
return
28462846

28472847
if not context_diff.has_changes:
2848-
self._print(f"**No differences when compared to `{context_diff.environment}`**\n")
2848+
self._print(
2849+
f"\n**No changes to plan: project files match the `{context_diff.environment}` environment**\n"
2850+
)
28492851
return
28502852

2853+
self._print(f"**Summary of differences from `{context_diff.environment}`:**\n")
2854+
28512855
if context_diff.has_requirement_changes:
28522856
self._print(f"Requirements:\n{context_diff.requirements_diff()}")
28532857

tests/integrations/github/cicd/test_github_commands.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ def test_run_all_success_with_approvers_approved(
144144
<details>
145145
<summary>:ship: Prod Plan Being Applied</summary>
146146
147-
**New environment `prod` will be created from `prod`**"""
147+
148+
**`prod` environment will be initialized**"""
148149
)
149150
with open(github_output_file, "r", encoding="utf-8") as f:
150151
output = f.read()
@@ -271,7 +272,8 @@ def test_run_all_success_with_approvers_approved_merge_delete(
271272
<details>
272273
<summary>:ship: Prod Plan Being Applied</summary>
273274
274-
**New environment `prod` will be created from `prod`**"""
275+
276+
**`prod` environment will be initialized**"""
275277
)
276278
with open(github_output_file, "r", encoding="utf-8") as f:
277279
output = f.read()
@@ -918,7 +920,8 @@ def raise_on_prod_plan(plan: Plan):
918920
<details>
919921
<summary>:ship: Prod Plan Being Applied</summary>
920922
921-
**New environment `prod` will be created from `prod`**"""
923+
924+
**`prod` environment will be initialized**"""
922925
)
923926

924927
with open(github_output_file, "r", encoding="utf-8") as f:
@@ -1210,7 +1213,8 @@ def test_comment_command_deploy_prod(
12101213
<details>
12111214
<summary>:ship: Prod Plan Being Applied</summary>
12121215
1213-
**New environment `prod` will be created from `prod`**"""
1216+
1217+
**`prod` environment will be initialized**"""
12141218
)
12151219

12161220
with open(github_output_file, "r", encoding="utf-8") as f:

tests/integrations/github/cicd/test_integration.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,15 @@ def test_merge_pr_has_non_breaking_change(
287287
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
288288
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
289289
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
290-
expected_prod_plan_summary = """**Summary of differences against `prod`:**
290+
expected_prod_plan_summary = """**Summary of differences from `prod`:**
291291
292292
293293
**Directly Modified:**
294294
- `sushi.waiter_revenue_by_day`
295295
```diff
296-
---
296+
---
297297
298-
+++
298+
+++
299299
300300
@@ -16,7 +16,8 @@
301301
@@ -484,15 +484,15 @@ def test_merge_pr_has_non_breaking_change_diff_start(
484484
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
485485
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
486486
assert prod_plan_preview_checks_runs[2]["output"]["title"] == "Prod Plan Preview"
487-
expected_prod_plan = """**Summary of differences against `prod`:**
487+
expected_prod_plan = """**Summary of differences from `prod`:**
488488
489489
490490
**Directly Modified:**
491491
- `sushi.waiter_revenue_by_day`
492492
```diff
493-
---
493+
---
494494
495-
+++
495+
+++
496496
497497
@@ -16,7 +16,8 @@
498498
@@ -827,7 +827,9 @@ def test_merge_pr_has_no_changes(
827827
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
828828
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
829829
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
830-
expected_prod_plan_summary = "**No differences when compared to `prod`**\n\n\n"
830+
expected_prod_plan_summary = (
831+
"\n**No changes to plan: project files match the `prod` environment**\n\n\n"
832+
)
831833
assert prod_plan_preview_checks_runs[2]["output"]["title"] == "Prod Plan Preview"
832834
assert prod_plan_preview_checks_runs[2]["output"]["summary"] == expected_prod_plan_summary
833835

@@ -990,15 +992,15 @@ def test_no_merge_since_no_deploy_signal(
990992
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
991993
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
992994
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
993-
expected_prod_plan = """**Summary of differences against `prod`:**
995+
expected_prod_plan = """**Summary of differences from `prod`:**
994996
995997
996998
**Directly Modified:**
997999
- `sushi.waiter_revenue_by_day`
9981000
```diff
999-
---
1001+
---
10001002
1001-
+++
1003+
+++
10021004
10031005
@@ -16,7 +16,8 @@
10041006
@@ -1171,15 +1173,15 @@ def test_no_merge_since_no_deploy_signal_no_approvers_defined(
11711173
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
11721174
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
11731175
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
1174-
expected_prod_plan = """**Summary of differences against `prod`:**
1176+
expected_prod_plan = """**Summary of differences from `prod`:**
11751177
11761178
11771179
**Directly Modified:**
11781180
- `sushi.waiter_revenue_by_day`
11791181
```diff
1180-
---
1182+
---
11811183
1182-
+++
1184+
+++
11831185
11841186
@@ -16,7 +16,8 @@
11851187
@@ -1341,15 +1343,15 @@ def test_deploy_comment_pre_categorized(
13411343
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
13421344
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
13431345
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
1344-
expected_prod_plan = """**Summary of differences against `prod`:**
1346+
expected_prod_plan = """**Summary of differences from `prod`:**
13451347
13461348
13471349
**Directly Modified:**
13481350
- `sushi.waiter_revenue_by_day`
13491351
```diff
1350-
---
1352+
---
13511353
1352-
+++
1354+
+++
13531355
13541356
@@ -16,7 +16,8 @@
13551357
@@ -1680,15 +1682,15 @@ def test_overlapping_changes_models(
16801682
assert GithubCheckStatus(prod_plan_preview_checks_runs[1]["status"]).is_in_progress
16811683
assert GithubCheckStatus(prod_plan_preview_checks_runs[2]["status"]).is_completed
16821684
assert GithubCheckConclusion(prod_plan_preview_checks_runs[2]["conclusion"]).is_success
1683-
expected_prod_plan_summary = """**Summary of differences against `prod`:**
1685+
expected_prod_plan_summary = """**Summary of differences from `prod`:**
16841686
16851687
16861688
**Directly Modified:**
16871689
- `sushi.customers`
16881690
```diff
1689-
---
1691+
---
16901692
1691-
+++
1693+
+++
16921694
16931695
@@ -25,7 +25,8 @@
16941696
@@ -1875,7 +1877,7 @@ def test_pr_delete_model(
18751877
== """<table><thead><tr><th colspan="3">PR Environment Summary</th></tr><tr><th>Model</th><th>Change Type</th><th>Dates Loaded</th></tr></thead><tbody><tr><td>"memory"."sushi"."top_waiters"</td><td>Breaking</td><td>REMOVED</td></tr></tbody></table>"""
18761878
)
18771879

1878-
expected_prod_plan_summary = """**Summary of differences against `prod`:**
1880+
expected_prod_plan_summary = """**Summary of differences from `prod`:**
18791881
18801882
18811883
**Removed Models:**

0 commit comments

Comments
 (0)