Skip to content

Commit

Permalink
Excavator: Switch to JUnit 5 to parallelize tests and speed up CI (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-excavator-bot authored Jan 10, 2022
1 parent 6aa3752 commit ed6aa32
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions gradle-conjure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ dependencies {
testImplementation 'org.mockito:mockito-core'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine'
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.vintage:junit-vintage-engine', {
because 'allows JUnit 3 and JUnit 4 tests to run'
}
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URLClassLoader;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Optional;
import net.bytebuddy.ByteBuddy;
Expand Down Expand Up @@ -158,7 +159,7 @@ public void invoke(Project project, String failedTo, List<String> unloggedArgs,
if (exitValue != 0) {
throw new RuntimeException(String.format(
"Failed to %s. The command '%s' failed with exit code %d. Output:\n%s",
failedTo, combinedArgs, exitValue, output.toString()));
failedTo, combinedArgs, exitValue, output.toString(StandardCharsets.UTF_8)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import com.google.common.collect.ImmutableMap;
import com.palantir.gradle.conjure.api.GeneratorOptions;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class RenderGeneratorOptionsTest {
private final GeneratorOptions generatorOptions = new GeneratorOptions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import java.io.File;
import java.nio.file.Paths;
import org.junit.Test;
import org.junit.jupiter.api.Test;

public class ReverseEngineerJavaStartScriptTest {

Expand Down
4 changes: 2 additions & 2 deletions versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ org.hamcrest:hamcrest:2.2 (1 constraints: d20cdc04)
org.hamcrest:hamcrest-core:1.3 (1 constraints: cc05fe3f)
org.jetbrains:annotations:20.1.0 (1 constraints: 5f0d6b2c)
org.junit:junit-bom:5.7.2 (11 constraints: 46b2df2f)
org.junit.jupiter:junit-jupiter:5.7.2 (1 constraints: 15098a95)
org.junit.jupiter:junit-jupiter:5.7.2 (2 constraints: 200ee058)
org.junit.jupiter:junit-jupiter-api:5.7.2 (4 constraints: 87383d33)
org.junit.jupiter:junit-jupiter-engine:5.7.2 (2 constraints: 1f17a43c)
org.junit.jupiter:junit-jupiter-params:5.7.2 (2 constraints: 1f17a43c)
org.junit.platform:junit-platform-commons:1.7.2 (3 constraints: eb29562b)
org.junit.platform:junit-platform-engine:1.7.2 (4 constraints: 823c4ddb)
org.junit.platform:junit-platform-launcher:1.7.2 (2 constraints: 101b5c4a)
org.junit.platform:junit-platform-testkit:1.7.2 (1 constraints: 11097695)
org.junit.vintage:junit-vintage-engine:5.7.2 (1 constraints: 15098a95)
org.junit.vintage:junit-vintage-engine:5.7.2 (2 constraints: 200ee058)
org.mockito:mockito-core:4.2.0 (1 constraints: 08050536)
org.objenesis:objenesis:3.2 (4 constraints: 142904bf)
org.opentest4j:opentest4j:1.2.0 (3 constraints: c53224a1)
Expand Down
4 changes: 3 additions & 1 deletion versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ junit:junit = 4.13.2
org.apache.commons:commons-lang3 = 3.12.0
org.assertj:* = 3.22.0
org.immutables:value = 2.8.8
org.mockito:mockito-core = 4.2.0
org.junit.jupiter:* = 5.5.0
org.junit.vintage:* = 5.5.0
org.mockito:* = 4.2.0
org.spockframework:* = 2.0-groovy-3.0
com.palantir.sls-packaging:* = 7.13.0
com.palantir.conjure.java.runtime:* = 7.22.0
Expand Down

0 comments on commit ed6aa32

Please sign in to comment.