Skip to content

Commit

Permalink
JS-523 Remove queries and assertions on non-persisted metrics (#5052)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource authored Jan 7, 2025
1 parent c7f5058 commit 2f06155
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2f06155

Please sign in to comment.