From 7bd22af432d9cf3861bb839a29b8377a1a314f75 Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Thu, 26 Sep 2024 10:54:33 -0500 Subject: [PATCH 1/3] Insight should not be generated with non-zero effort Signed-off-by: Nandini Chandra --- tests/test_insights.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_insights.py b/tests/test_insights.py index 7bc8a4a..b363174 100644 --- a/tests/test_insights.py +++ b/tests/test_insights.py @@ -58,3 +58,5 @@ def test_custom_rules(analysis_data, analysis_mode): 'Properties file (Insights TC1)', 'Properties file (Insights TC2)'): # Assert insight occurrence is > 0 for each insight assert len(insight['incidents']) > 0, "No insights were generated" + else: + assert insight['description'] is not 'Properties file (Insights TC3', "Bug MTA-3352 Insight incorrectly generated" From 50697c9caf614de5680dc112705acfa955fa375b Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Fri, 27 Sep 2024 12:32:36 -0500 Subject: [PATCH 2/3] Add bug marker Signed-off-by: Nandini Chandra --- data/yaml/custom_rule_insights.yaml | 10 ++++++++++ tests/test_insights.py | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/data/yaml/custom_rule_insights.yaml b/data/yaml/custom_rule_insights.yaml index 09f32dd..d240ac4 100644 --- a/data/yaml/custom_rule_insights.yaml +++ b/data/yaml/custom_rule_insights.yaml @@ -23,3 +23,13 @@ when: builtin.file: pattern: "^.*\\.properties$" +- ruleID: discover-properties-file-TC3 + description: "Properties file (Insights TC3)" + labels: + - konveyor.io/target=discovery + tag: ["Properties File (Insights TC3)"] + message: Found properties file, Insight muts not be created + effort: 1 + when: + builtin.file: + pattern: "^.*\\.properties$" diff --git a/tests/test_insights.py b/tests/test_insights.py index b363174..4265348 100644 --- a/tests/test_insights.py +++ b/tests/test_insights.py @@ -24,7 +24,7 @@ def test_insights_binary_app(analysis_data): # Polarion TC 3503, 3504, 3505, 3506 @pytest.mark.parametrize('analysis_mode', ["source-only", "full"]) -def test_custom_rules(analysis_data, analysis_mode): +def test_insights_custom_rules_bug_mta_3352(analysis_data, analysis_mode): application_data = analysis_data['tackle-testapp-project'] custom_rule_path = os.path.join(os.getenv(constants.PROJECT_PATH), 'data/yaml', 'custom_rule_insights.yaml') @@ -59,4 +59,5 @@ def test_custom_rules(analysis_data, analysis_mode): # Assert insight occurrence is > 0 for each insight assert len(insight['incidents']) > 0, "No insights were generated" else: - assert insight['description'] is not 'Properties file (Insights TC3', "Bug MTA-3352 Insight incorrectly generated" + assert insight['description'] != 'Properties file (Insights TC3)', \ + "Insight incorrectly generated" From c2a0503e8d9aefe2b01723983f3635e030df782f Mon Sep 17 00:00:00 2001 From: Nandini Chandra Date: Fri, 27 Sep 2024 13:21:44 -0500 Subject: [PATCH 3/3] Add Polarion TC Signed-off-by: Nandini Chandra --- tests/test_insights.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_insights.py b/tests/test_insights.py index 4265348..5bee8be 100644 --- a/tests/test_insights.py +++ b/tests/test_insights.py @@ -22,7 +22,7 @@ def test_insights_binary_app(analysis_data): assert 'generating static report' in output assert_insights_from_report_file() -# Polarion TC 3503, 3504, 3505, 3506 +# Polarion TC 576, 577, 578, 589, 606 @pytest.mark.parametrize('analysis_mode', ["source-only", "full"]) def test_insights_custom_rules_bug_mta_3352(analysis_data, analysis_mode): application_data = analysis_data['tackle-testapp-project']