Skip to content

Commit

Permalink
fixes #975
Browse files Browse the repository at this point in the history
Improve default ignorePatterns
  • Loading branch information
fabapp2 authored Oct 19, 2023
1 parent f8cac7c commit f16447e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public List<SourceFile> processMainSources(
mainProjectProvenance.add(sourceSet("main", dependencies, typeCache));

// FIXME: 945 Why target and not all main?
List<Path> parsedJavaPaths = mainJavaSources.stream().map(ResourceUtil::getPath).toList();
List<Path> parsedJavaPaths = javaSourcesInTarget.stream().map(ResourceUtil::getPath).toList();
Stream<SourceFile> parsedJava = cus.map(addProvenance(baseDir, mainProjectProvenance, parsedJavaPaths));
log.debug("[%s] Scanned %d java source files in main scope.".formatted(currentProject, mainJavaSources.size()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
* @author Fabian Krüger
*/
@SpringBootTest(classes = {SbmSupportRewriteConfiguration.class, SbmTestConfiguration.class})
@Issue("https://github.com/spring-projects-experimental/spring-boot-migrator/issues/975")
public class CompareParserRecipeRunTest {

@Autowired
Expand All @@ -58,9 +57,8 @@ public class CompareParserRecipeRunTest {
private ExecutionContext executionContext;

@Test
@DisplayName("runningRecipe")
@ExpectedToFail("FIXME: #975")
void runningRecipe() {
@DisplayName("Running a recipe with RewriteMavenParser should yield the same result as with RewriteProjectParser")
void runningARecipeWithRewriteMavenParserYieldsTheSameResultAsWithRewriteProjectParser() {
Path baseDir = TestProjectHelper.getMavenProject("parser-recipe-run");
RewriteProjectParsingResult sutParsingResult = sut.parse(baseDir);
RewriteProjectParsingResult compParsingResult = comparingParser.parse(baseDir);
Expand Down Expand Up @@ -105,7 +103,7 @@ public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, Ex
// Run Parser independent from Maven
counter.setRelease(0);
RecipeRun sutRecipeRun = recipe.run(new InMemoryLargeSourceSet(sutParsingResult.sourceFiles()), executionContext);
assertThat(counter.get()).isEqualTo(3); // differs, should be 2
assertThat(counter.get()).isEqualTo(2); // differs, should be 2
assertThat(sutRecipeRun.getChangeset().getAllResults()).hasSize(1); // is 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void defaultActiveProfiles() {
@Test
@DisplayName("parser.ignoredPathPatterns")
void defaultIgnoredPathPatterns() {
assertThat(parserProperties.getIgnoredPathPatterns()).containsExactlyInAnyOrder("target/**", "**.git", "**/target/**", "**.idea");
assertThat(parserProperties.getIgnoredPathPatterns()).containsExactlyInAnyOrder("**.idea/**", "**.git", "**/target/**", "target/**");
}

}
Expand Down

0 comments on commit f16447e

Please sign in to comment.