Skip to content

Commit

Permalink
Merge pull request #16943 from stuartwdouglas/test-app-root
Browse files Browse the repository at this point in the history
Make test classes the highest priority
  • Loading branch information
stuartwdouglas authored May 3, 2021
2 parents 0144d3a + b9a0e0e commit 7a3cf00
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.quarkus.deployment.dev.testing;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
Expand All @@ -9,9 +11,9 @@

import org.jboss.logging.Logger;

import io.quarkus.bootstrap.app.AdditionalDependency;
import io.quarkus.bootstrap.app.CuratedApplication;
import io.quarkus.bootstrap.app.QuarkusBootstrap;
import io.quarkus.bootstrap.model.PathsCollection;
import io.quarkus.deployment.dev.CompilationProvider;
import io.quarkus.deployment.dev.DevModeContext;
import io.quarkus.deployment.dev.QuarkusCompiler;
Expand Down Expand Up @@ -115,16 +117,17 @@ public void init() {
}
if (testCuratedApplication == null) {
try {
List<Path> paths = new ArrayList<>();
paths.add(Paths.get(context.getApplicationRoot().getTest().get().getClassesPath()));
paths.addAll(curatedApplication.getQuarkusBootstrap().getApplicationRoot().toList());
testCuratedApplication = curatedApplication.getQuarkusBootstrap().clonedBuilder()
.setMode(QuarkusBootstrap.Mode.TEST)
.setDisableClasspathCache(false)
.setIsolateDeployment(true)
.setBaseClassLoader(getClass().getClassLoader())
.setTest(true)
.setAuxiliaryApplication(true)
.addAdditionalApplicationArchive(new AdditionalDependency(
Paths.get(context.getApplicationRoot().getTest().get().getClassesPath()), true,
true))
.setApplicationRoot(PathsCollection.from(paths))
.build()
.bootstrap();
compiler = new QuarkusCompiler(testCuratedApplication, compilationProviders, context);
Expand Down

0 comments on commit 7a3cf00

Please sign in to comment.