From 2f061555ed0cd0eb5d0e992db625c7154a2bbcbe Mon Sep 17 00:00:00 2001 From: Yassin Kammoun <52890329+yassin-kammoun-sonarsource@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:02:56 +0100 Subject: [PATCH] JS-523 Remove queries and assertions on non-persisted metrics (#5052) --- .../javascript/it/plugin/CssMetricsTest.java | 72 ------------------- .../javascript/it/plugin/MetricsTest.java | 19 ----- 2 files changed, 91 deletions(-) diff --git a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/CssMetricsTest.java b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/CssMetricsTest.java index 586d23d94a9..b668f1e008d 100644 --- a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/CssMetricsTest.java +++ b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/CssMetricsTest.java @@ -45,77 +45,5 @@ void test() { "css=27;php=1;web=24" ); assertThat(getMeasureAsDouble(PROJECT_KEY, "comment_lines")).isEqualTo(6); - - assertThat(getMeasure(PROJECT_KEY + ":src/file1.css", "ncloc_data").getValue()).contains( - "1=1;", - "2=1;", - "3=1;", - "4=1;", - "5=1;", - "6=1;", - "7=1" - ); - - assertThat(getMeasure(PROJECT_KEY + ":src/file2.less", "ncloc_data").getValue()).contains( - "1=1;", - "2=1;", - "3=1;", - "4=1;", - "5=1;", - "6=1;", - "7=1;", - "8=1;", - "9=1" - ); - - assertThat(getMeasure(PROJECT_KEY + ":src/file3.scss", "ncloc_data").getValue()).contains( - "1=1;", - "3=1;", - "5=1;", - "6=1;", - "7=1;", - "8=1" - ); - - assertThat(getMeasure(PROJECT_KEY + ":src/file4.sass", "ncloc_data").getValue()).contains( - "1=1", - "3=1", - "5=1", - "6=1", - "7=1" - ); - - assertThat(getMeasure(PROJECT_KEY + ":src/file5.html", "ncloc_data").getValue()).contains( - "1=1", - "2=1", - "3=1", - "4=1", - "5=1", - "6=1", - "7=1", - "8=1", - "9=1", - "10=1" - ); - - // .htm is not part of sonar-HTML languages. When it is, an assertion should be added for file6.htm - // https://sonarsource.atlassian.net/jira/software/c/projects/SONARHTML/issues/SONARHTML-180 - - assertThat(getMeasure(PROJECT_KEY + ":src/file7.xhtml", "ncloc_data").getValue()).contains( - "1=1", - "2=1", - "4=1", - "5=1", - "6=1", - "7=1", - "8=1", - "9=1", - "10=1", - "11=1", - "12=1", - "13=1", - "14=1", - "15=1" - ); } } diff --git a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/MetricsTest.java b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/MetricsTest.java index b729f6ae103..104788ac28b 100644 --- a/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/MetricsTest.java +++ b/its/plugin/tests/src/test/java/com/sonar/javascript/it/plugin/MetricsTest.java @@ -109,25 +109,6 @@ void file_level() { assertThat(getFileMeasureAsDouble("violations")).isZero(); } - /** - * SONARPLUGINS-2183 - */ - @Test - void should_be_compatible_with_DevCockpit() { - // 2 header comment line - // 4 empty line - // 5 code line - // 14 comment line - // 15 empty comment line - - assertThat(getFileMeasure("ncloc_data").getValue()) - .doesNotContain(";2=1;") - .doesNotContain(";4=1;") - .contains("5=1;") - .doesNotContain(";14=1;") - .doesNotContain(";15=1;"); - } - /* Helper methods */ private Double getProjectMeasureAsDouble(String metricKey) {