Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS-523 Remove queries and assertions on non-persisted metrics #5052

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading