Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Apr 3, 2020
1 parent 13cbe9f commit ae601e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -81,6 +82,9 @@ public void canBuild(SourceType sourceType) throws IOException, InterruptedExcep
assertThat(build.task(":build").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
// gradle build should not build the native image
assertThat(build.task(":buildNative")).isNull();
Path buildDir = projectRoot.toPath().resolve("build");
assertThat(buildDir).exists();
assertThat(buildDir.resolve("foo-1.0.0-SNAPSHOT-runner")).doesNotExist();
}

private void createProject(SourceType sourceType) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ private void registerTasks(Project project) {
testNative.dependsOn(quarkusBuild);
testNative.setShouldRunAfter(Collections.singletonList(tasks.findByName(JavaPlugin.TEST_TASK_NAME)));

Consumer<QuarkusTestNative> configureTestNativeTask = t -> project.getExtensions().getExtraProperties()
.set("quarkus.package.type", "native");
tasks.withType(QuarkusTestNative.class).forEach(configureTestNativeTask);
tasks.withType(QuarkusTestNative.class).whenTaskAdded(configureTestNativeTask::accept);
project.getGradle().getTaskGraph().whenReady(taskGraph -> {
if (taskGraph.hasTask(testNative)) {
project.getExtensions().getExtraProperties()
.set("quarkus.package.type", "native");
}
});

Consumer<Test> configureTestTask = t -> {
// Quarkus test configuration task which should be executed before any Quarkus test
Expand Down

0 comments on commit ae601e0

Please sign in to comment.