From 27fef8f7b654fc9569fef637bc20041a17b26ac5 Mon Sep 17 00:00:00 2001 From: Carter Kozak Date: Thu, 13 Oct 2022 13:48:25 -0400 Subject: [PATCH 1/2] Revert a dependency bump to run all tests once again Revert "Excavator: Upgrade dependencies (#2342)" This reverts commit 2c966d90528e0a40c0ea0f43fb3a7368248d2e47. --- baseline-refaster-rules/build.gradle | 6 +----- baseline-refaster-testing/build.gradle | 6 +----- build.gradle | 5 ----- versions.lock | 10 +++++----- versions.props | 4 ++-- 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/baseline-refaster-rules/build.gradle b/baseline-refaster-rules/build.gradle index 1cc1c1ff5..1b477e930 100644 --- a/baseline-refaster-rules/build.gradle +++ b/baseline-refaster-rules/build.gradle @@ -10,10 +10,6 @@ dependencies { testImplementation project(':baseline-refaster-testing') testImplementation 'org.immutables:value::annotations' - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine', { - because 'allows JUnit 3 and JUnit 4 tests to run' - } - compileOnly 'org.immutables:value::annotations' } @@ -39,4 +35,4 @@ moduleJvmArgs { 'jdk.compiler/com.sun.tools.javac.util' ] opens = ['jdk.compiler/com.sun.tools.javac.comp'] -} +} \ No newline at end of file diff --git a/baseline-refaster-testing/build.gradle b/baseline-refaster-testing/build.gradle index 3d66eae07..5c816c4a8 100644 --- a/baseline-refaster-testing/build.gradle +++ b/baseline-refaster-testing/build.gradle @@ -24,10 +24,6 @@ dependencies { api 'com.google.guava:guava' api 'junit:junit' api 'org.assertj:assertj-core' - - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine', { - because 'allows JUnit 3 and JUnit 4 tests to run' - } } tasks.checkClassUniqueness.enabled = false @@ -46,4 +42,4 @@ moduleJvmArgs { 'jdk.compiler/com.sun.tools.javac.tree', 'jdk.compiler/com.sun.tools.javac.util' ] -} +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 21c13162e..d2e3f1280 100644 --- a/build.gradle +++ b/build.gradle @@ -53,11 +53,6 @@ allprojects { check("PreconditionsConstantMessage", CheckSeverity.OFF) } } - tasks.withType(Test) { - useJUnitPlatform { - includeEngines 'junit-vintage', 'junit-jupiter' - } - } } apply plugin: 'org.inferred.processors' diff --git a/versions.lock b/versions.lock index b816ca7b0..57c679f5f 100644 --- a/versions.lock +++ b/versions.lock @@ -72,8 +72,8 @@ org.assertj:assertj-core:3.23.1 (3 constraints: e42af49e) org.checkerframework:checker-qual:3.23.0 (3 constraints: 08256088) org.checkerframework:dataflow-errorprone:3.23.0 (4 constraints: fa3d685c) org.checkerframework:dataflow-nullaway:3.23.0 (2 constraints: 671166f1) -org.codehaus.groovy:groovy:3.0.13 (3 constraints: 3a295322) -org.codehaus.groovy:groovy-xml:3.0.13 (1 constraints: 791161da) +org.codehaus.groovy:groovy:3.0.10 (3 constraints: e32879d6) +org.codehaus.groovy:groovy-xml:3.0.10 (1 constraints: 791161da) org.codehaus.plexus:plexus-cipher:2.0 (1 constraints: 641174c7) org.codehaus.plexus:plexus-classworlds:2.6.0 (3 constraints: 572b5104) org.codehaus.plexus:plexus-component-annotations:2.1.0 (2 constraints: 241d860a) @@ -129,10 +129,10 @@ org.junit.jupiter:junit-jupiter-engine:5.9.1 (1 constraints: 0c0ee13b) org.junit.jupiter:junit-jupiter-migrationsupport:5.9.1 (1 constraints: 11052036) org.junit.jupiter:junit-jupiter-params:5.9.1 (1 constraints: 0c0ee13b) org.junit.platform:junit-platform-commons:1.9.1 (2 constraints: dd200f4b) -org.junit.platform:junit-platform-engine:1.9.1 (3 constraints: 602e797f) +org.junit.platform:junit-platform-engine:1.9.1 (3 constraints: 602e777f) org.junit.vintage:junit-vintage-engine:5.9.1 (1 constraints: 11052036) org.mockito:mockito-junit-jupiter:4.8.0 (1 constraints: 0e051736) org.opentest4j:opentest4j:1.2.0 (2 constraints: cd205b49) org.reactivestreams:reactive-streams:1.0.3 (1 constraints: ef07e77b) -org.spockframework:spock-core:2.3-groovy-3.0 (2 constraints: 3c22e7f5) -org.spockframework:spock-junit4:2.3-groovy-3.0 (1 constraints: 241154df) +org.spockframework:spock-core:2.1-M2-groovy-3.0 (2 constraints: e622905a) +org.spockframework:spock-junit4:2.1-M2-groovy-3.0 (1 constraints: 241154df) diff --git a/versions.props b/versions.props index 9e9f1d370..43639e4ca 100644 --- a/versions.props +++ b/versions.props @@ -35,8 +35,6 @@ org.junit.jupiter:* = 5.9.1 org.junit.vintage:* = 5.9.1 org.junit.platform:* = 1.9.1 org.mockito:* = 4.8.0 -org.codehaus.groovy:* = 3.0.13 -org.spockframework:* = 2.3-groovy-3.0 # dependency-upgrader:OFF # Don't upgrade, we will remove this in a future release. @@ -49,4 +47,6 @@ com.diffplug.spotless:spotless-plugin-gradle = 6.6.0 com.google.errorprone:error_prone_* = 2.15.0 com.uber.nullaway:nullaway = 0.9.9 org.checkerframework:* = 3.23.0 +# Groovy versions must be compatible with gradle +org.codehaus.groovy:* = 3.0.10 # dependency-upgrader:ON From 56b76cd4bf0be575f8a2e87cc4e6fcaa1f556a10 Mon Sep 17 00:00:00 2001 From: Carter Kozak Date: Thu, 13 Oct 2022 13:57:05 -0400 Subject: [PATCH 2/2] junit4->5 --- .../errorprone/JooqResultStreamLeakTest.java | 48 +------------------ 1 file changed, 1 insertion(+), 47 deletions(-) diff --git a/baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/JooqResultStreamLeakTest.java b/baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/JooqResultStreamLeakTest.java index 530a2eac2..0650eab3e 100644 --- a/baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/JooqResultStreamLeakTest.java +++ b/baseline-error-prone/src/test/java/com/palantir/baseline/errorprone/JooqResultStreamLeakTest.java @@ -17,7 +17,7 @@ package com.palantir.baseline.errorprone; import com.google.errorprone.CompilationTestHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; public final class JooqResultStreamLeakTest { @@ -27,31 +27,6 @@ public final class JooqResultStreamLeakTest { private final RefactoringValidator refactoringValidator = RefactoringValidator.of(JooqResultStreamLeak.class, getClass()); - @Test - public void test_positive() { - testHelper - .addSourceLines( - "JooqStream.java", - "import java.util.stream.Collectors;", - "import java.util.stream.Stream;", - "import org.jooq.Record;", - "import org.jooq.ResultQuery;", - "class Test {", - " void f(ResultQuery rq) {", - " // BUG: Diagnostic contains: should be closed", - " rq.stream().map(r -> r.getValue(0));", - " // BUG: Diagnostic contains: should be closed", - " rq.fetchStream().map(r -> r.getValue(0));", - " // BUG: Diagnostic contains: should be closed", - " rq.fetchLazy();", - " try (Stream stream = rq.stream().collect(Collectors.toList()).stream()) {", - " stream.collect(Collectors.joining(\", \"));", - " }", - " }", - "}") - .doTest(); - } - @Test public void test_query_steps_ignored() { testHelper @@ -69,27 +44,6 @@ public void test_query_steps_ignored() { .doTest(); } - @Test - public void test_negative() { - testHelper - .addSourceLines( - "JooqStream.java", - "import java.util.stream.Stream;", - "import org.jooq.Record;", - "import org.jooq.ResultQuery;", - "class Test {", - " void f(ResultQuery rq) {", - " try (Stream stream = rq.stream()) {", - " Stream> newStream = stream.map(r -> r.getValue(0));", - " }", - " try (Stream stream = rq.fetchStream()) {", - " Stream> newStream = stream.map(r -> r.getValue(0));", - " }", - " }", - "}") - .doTest(); - } - @Test public void test_fix() { refactoringValidator