From 558e405423667e4e99db8289bd072b12dff48d15 Mon Sep 17 00:00:00 2001 From: Max Amelchenko Date: Wed, 28 Aug 2024 17:02:32 +0300 Subject: [PATCH] fix tests due to an added passed provider check --- .../image_referencer/test_plan_runner_aws_resources.py | 10 +++++----- tests/terraform/runner/test_plan_runner.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/terraform/image_referencer/test_plan_runner_aws_resources.py b/tests/terraform/image_referencer/test_plan_runner_aws_resources.py index b44e2b327f8..5c3f7658a13 100644 --- a/tests/terraform/image_referencer/test_plan_runner_aws_resources.py +++ b/tests/terraform/image_referencer/test_plan_runner_aws_resources.py @@ -50,7 +50,7 @@ def test_apprunner_resources(mocker: MockerFixture, graph_framework): sca_image_report = next(report for report in reports if report.check_type == CheckType.SCA_IMAGE) assert len(tf_report.resources) == 1 - assert len(tf_report.passed_checks) == 0 + assert len(tf_report.passed_checks) == 1 assert len(tf_report.failed_checks) == 0 assert len(tf_report.skipped_checks) == 0 assert len(tf_report.parsing_errors) == 0 @@ -109,7 +109,7 @@ def test_batch_resources(mocker: MockerFixture, graph_framework): sca_image_report = next(report for report in reports if report.check_type == CheckType.SCA_IMAGE) assert len(tf_report.resources) == 1 - assert len(tf_report.passed_checks) == 1 + assert len(tf_report.passed_checks) == 2 assert len(tf_report.failed_checks) == 0 assert len(tf_report.skipped_checks) == 0 assert len(tf_report.parsing_errors) == 0 @@ -151,7 +151,7 @@ def test_codebuild_resources(mocker: MockerFixture, graph_framework): sca_image_report = next(report for report in reports if report.check_type == CheckType.SCA_IMAGE) assert len(tf_report.resources) == 3 - assert len(tf_report.passed_checks) == 8 + assert len(tf_report.passed_checks) == 9 assert len(tf_report.failed_checks) == 2 assert len(tf_report.skipped_checks) == 0 assert len(tf_report.parsing_errors) == 0 @@ -195,7 +195,7 @@ def test_ecs_resources(mocker: MockerFixture, graph_framework): sca_image_report = next(report for report in reports if report.check_type == CheckType.SCA_IMAGE) assert len(tf_report.resources) == 1 - assert len(tf_report.passed_checks) == 4 + assert len(tf_report.passed_checks) == 5 assert len(tf_report.failed_checks) == 1 assert len(tf_report.skipped_checks) == 0 assert len(tf_report.parsing_errors) == 0 @@ -240,7 +240,7 @@ def test_lightsail_resources(mocker: MockerFixture, graph_framework): sca_image_report = next(report for report in reports if report.check_type == CheckType.SCA_IMAGE) assert len(tf_report.resources) == 2 - assert len(tf_report.passed_checks) == 0 + assert len(tf_report.passed_checks) == 1 assert len(tf_report.failed_checks) == 0 assert len(tf_report.skipped_checks) == 0 assert len(tf_report.parsing_errors) == 0 diff --git a/tests/terraform/runner/test_plan_runner.py b/tests/terraform/runner/test_plan_runner.py index be2513c186c..fdfcd858815 100644 --- a/tests/terraform/runner/test_plan_runner.py +++ b/tests/terraform/runner/test_plan_runner.py @@ -297,7 +297,7 @@ def test_runner_child_modules(self): self.assertEqual(report.get_exit_code({'soft_fail': True, 'soft_fail_checks': [], 'soft_fail_threshold': None, 'hard_fail_checks': [], 'hard_fail_threshold': None}), 0) self.assertEqual(report.get_summary()["failed"], 3) - self.assertEqual(report.get_summary()["passed"], 4) + self.assertEqual(report.get_summary()["passed"], 5) def test_runner_nested_child_modules(self): current_dir = os.path.dirname(os.path.realpath(__file__))