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

diff-test-selection: skip parametrized for selection #978

Merged
merged 1 commit into from
Dec 18, 2020
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 @@ -90,6 +90,9 @@ private Map<String, Set<String>> matchChangedWithCoverage(Map<String, Map<String
Map<String, Set<String>> testClassNamePerTestMethodNamesThatCoverChanges = new LinkedHashMap<>();
for (String testClassKey : coverage.keySet()) {
for (String testMethodKey : coverage.get(testClassKey).keySet()) {
if (this.isParametrized(testMethodKey)) {
continue;
}
for (String targetClassName : coverage.get(testClassKey).get(testMethodKey).keySet()) {
if (modifiedLinesPerQualifiedName.containsKey(targetClassName)) {
for (Integer line : modifiedLinesPerQualifiedName.get(targetClassName)) {
Expand All @@ -109,6 +112,10 @@ private Map<String, Set<String>> matchChangedWithCoverage(Map<String, Map<String
return testClassNamePerTestMethodNamesThatCoverChanges;
}

private boolean isParametrized(String testMethodKey) {
return testMethodKey.contains("[") && testMethodKey.contains("] ");
}

private Map<String, List<Integer>> getModifiedLinesPerQualifiedName(String currentLine,
String secondLine) {
final File baseDir = new File(this.configuration.pathToFirstVersion);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package eu.stamp_project.diff_test_selection.coverage;

import eu.stamp_project.diff_test_selection.configuration.Options;
import org.apache.maven.plugin.logging.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down