1313
1414issue_url = '' .join (random .choice (string .ascii_letters ) for _ in range (10 ))
1515comment_url = '' .join (random .choice (string .ascii_letters ) for _ in range (10 ))
16+ node_id = '' .join (random .choice (string .ascii_letters ) for _ in range (10 ))
1617
1718def test_path_only ():
1819 payload = '''Terraform plan in __/test/terraform__
@@ -31,6 +32,7 @@ def test_path_only():
3132 expected = TerraformComment (
3233 issue_url = issue_url ,
3334 comment_url = comment_url ,
35+ node_id = node_id ,
3436 status = 'Testing' ,
3537 headers = {},
3638 description = 'Terraform plan in __/test/terraform__' ,
@@ -42,6 +44,7 @@ def test_path_only():
4244 assert _from_api_payload ({
4345 'body' : payload ,
4446 'url' : comment_url ,
47+ 'node_id' : node_id ,
4548 'issue_url' : issue_url
4649 }) == expected
4750
@@ -63,6 +66,7 @@ def test_nondefault_workspace():
6366 expected = TerraformComment (
6467 issue_url = issue_url ,
6568 comment_url = comment_url ,
69+ node_id = node_id ,
6670 status = 'Testing' ,
6771 headers = {},
6872 description = 'Terraform plan in __/test/terraform__ in the __myworkspace__ workspace' ,
@@ -74,6 +78,7 @@ def test_nondefault_workspace():
7478 assert _from_api_payload ({
7579 'body' : payload ,
7680 'url' : comment_url ,
81+ 'node_id' : node_id ,
7782 'issue_url' : issue_url
7883 }) == expected
7984
@@ -97,6 +102,7 @@ def test_variables_single_line():
97102 expected = TerraformComment (
98103 issue_url = issue_url ,
99104 comment_url = comment_url ,
105+ node_id = node_id ,
100106 status = 'Testing' ,
101107 headers = {},
102108 description = 'Terraform plan in __/test/terraform__\n With variables: `var1="value"`' ,
@@ -108,6 +114,7 @@ def test_variables_single_line():
108114 assert _from_api_payload ({
109115 'body' : payload ,
110116 'url' : comment_url ,
117+ 'node_id' : node_id ,
111118 'issue_url' : issue_url
112119 }) == expected
113120
@@ -136,6 +143,7 @@ def test_variables_multi_line():
136143 expected = TerraformComment (
137144 issue_url = issue_url ,
138145 comment_url = comment_url ,
146+ node_id = node_id ,
139147 status = 'Testing' ,
140148 headers = {},
141149 description = '''Terraform plan in __/test/terraform__<details><summary>With variables</summary>
@@ -153,6 +161,7 @@ def test_variables_multi_line():
153161 assert _from_api_payload ({
154162 'body' : payload ,
155163 'url' : comment_url ,
164+ 'node_id' : node_id ,
156165 'issue_url' : issue_url
157166 }) == expected
158167
@@ -175,6 +184,7 @@ def test_var():
175184 expected = TerraformComment (
176185 issue_url = issue_url ,
177186 comment_url = comment_url ,
187+ node_id = node_id ,
178188 status = 'Testing' ,
179189 headers = {},
180190 description = '''Terraform plan in __/test/terraform__
@@ -187,6 +197,7 @@ def test_var():
187197 assert _from_api_payload ({
188198 'body' : payload ,
189199 'url' : comment_url ,
200+ 'node_id' : node_id ,
190201 'issue_url' : issue_url
191202 }) == expected
192203
@@ -209,6 +220,7 @@ def test_var_file():
209220 expected = TerraformComment (
210221 issue_url = issue_url ,
211222 comment_url = comment_url ,
223+ node_id = node_id ,
212224 status = 'Testing' ,
213225 headers = {},
214226 description = '''Terraform plan in __/test/terraform__
@@ -221,6 +233,7 @@ def test_var_file():
221233 assert _from_api_payload ({
222234 'body' : payload ,
223235 'url' : comment_url ,
236+ 'node_id' : node_id ,
224237 'issue_url' : issue_url
225238 }) == expected
226239
@@ -244,6 +257,7 @@ def test_backend_config():
244257 expected = TerraformComment (
245258 issue_url = issue_url ,
246259 comment_url = comment_url ,
260+ node_id = node_id ,
247261 status = 'Testing' ,
248262 headers = {},
249263 description = '''Terraform plan in __/test/terraform__
@@ -256,6 +270,7 @@ def test_backend_config():
256270 assert _from_api_payload ({
257271 'body' : payload ,
258272 'url' : comment_url ,
273+ 'node_id' : node_id ,
259274 'issue_url' : issue_url
260275 }) == expected
261276
@@ -278,6 +293,7 @@ def test_backend_config_bad_words():
278293 expected = TerraformComment (
279294 issue_url = issue_url ,
280295 comment_url = comment_url ,
296+ node_id = node_id ,
281297 status = 'Testing' ,
282298 headers = {},
283299 description = '''Terraform plan in __/test/terraform__
@@ -290,6 +306,7 @@ def test_backend_config_bad_words():
290306 assert _from_api_payload ({
291307 'body' : payload ,
292308 'url' : comment_url ,
309+ 'node_id' : node_id ,
293310 'issue_url' : issue_url
294311 }) == expected
295312
@@ -311,6 +328,7 @@ def test_target():
311328 expected = TerraformComment (
312329 issue_url = issue_url ,
313330 comment_url = comment_url ,
331+ node_id = node_id ,
314332 status = 'Testing' ,
315333 headers = {},
316334 description = '''Terraform plan in __/test/terraform__
@@ -323,6 +341,7 @@ def test_target():
323341 assert _from_api_payload ({
324342 'body' : payload ,
325343 'url' : comment_url ,
344+ 'node_id' : node_id ,
326345 'issue_url' : issue_url
327346 }) == expected
328347
@@ -344,6 +363,7 @@ def test_replace():
344363 expected = TerraformComment (
345364 issue_url = issue_url ,
346365 comment_url = comment_url ,
366+ node_id = node_id ,
347367 status = 'Testing' ,
348368 headers = {},
349369 description = '''Terraform plan in __/test/terraform__
@@ -356,6 +376,7 @@ def test_replace():
356376 assert _from_api_payload ({
357377 'body' : payload ,
358378 'url' : comment_url ,
379+ 'node_id' : node_id ,
359380 'issue_url' : issue_url
360381 }) == expected
361382
@@ -378,6 +399,7 @@ def test_backend_config_file():
378399 expected = TerraformComment (
379400 issue_url = issue_url ,
380401 comment_url = comment_url ,
402+ node_id = node_id ,
381403 status = 'Testing' ,
382404 headers = {},
383405 description = '''Terraform plan in __/test/terraform__
@@ -390,6 +412,7 @@ def test_backend_config_file():
390412 assert _from_api_payload ({
391413 'body' : payload ,
392414 'url' : comment_url ,
415+ 'node_id' : node_id ,
393416 'issue_url' : issue_url
394417 }) == expected
395418
@@ -417,6 +440,7 @@ def test_all():
417440 expected = TerraformComment (
418441 issue_url = issue_url ,
419442 comment_url = comment_url ,
443+ node_id = node_id ,
420444 status = 'Testing' ,
421445 headers = {},
422446 description = '''Terraform plan in __/test/terraform__ in the __test__ workspace
@@ -434,6 +458,7 @@ def test_all():
434458 assert _from_api_payload ({
435459 'body' : payload ,
436460 'url' : comment_url ,
461+ 'node_id' : node_id ,
437462 'issue_url' : issue_url
438463 }) == expected
439464
@@ -455,6 +480,7 @@ def test_label():
455480 expected = TerraformComment (
456481 issue_url = issue_url ,
457482 comment_url = comment_url ,
483+ node_id = node_id ,
458484 status = 'Testing' ,
459485 headers = {},
460486 description = '''Terraform plan for __test_label__''' ,
@@ -466,6 +492,7 @@ def test_label():
466492 assert _from_api_payload ({
467493 'body' : payload ,
468494 'url' : comment_url ,
495+ 'node_id' : node_id ,
469496 'issue_url' : issue_url
470497 }) == expected
471498
@@ -489,6 +516,7 @@ def test_error():
489516 expected = TerraformComment (
490517 issue_url = issue_url ,
491518 comment_url = comment_url ,
519+ node_id = node_id ,
492520 status = ':x: Failed to generate plan in [Test terraform-plan #603](https://github.com/dflook/terraform-github-actions/actions/runs/6684032578)' ,
493521 headers = {},
494522 description = '''Terraform plan in __tests/workflows/test-plan/error__''' ,
@@ -504,6 +532,7 @@ def test_error():
504532 assert _from_api_payload ({
505533 'body' : payload ,
506534 'url' : comment_url ,
535+ 'node_id' : node_id ,
507536 'issue_url' : issue_url
508537 }) == expected
509538
@@ -524,6 +553,7 @@ def test_diff():
524553 expected = TerraformComment (
525554 issue_url = issue_url ,
526555 comment_url = comment_url ,
556+ node_id = node_id ,
527557 status = 'Testing' ,
528558 headers = {},
529559 description = 'Terraform plan in __/test/terraform__ in the __myworkspace__ workspace' ,
@@ -535,5 +565,6 @@ def test_diff():
535565 assert _from_api_payload ({
536566 'body' : payload ,
537567 'url' : comment_url ,
568+ 'node_id' : node_id ,
538569 'issue_url' : issue_url
539570 }) == expected
0 commit comments