Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert dependency bump which prevented some tests from running #2433

Merged
merged 2 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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<Record> 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<String> stream = rq.stream().collect(Collectors.toList()).stream()) {",
" stream.collect(Collectors.joining(\", \"));",
" }",
" }",
"}")
.doTest();
}

@Test
public void test_query_steps_ignored() {
testHelper
Expand All @@ -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<Record> stream = rq.stream()) {",
" Stream<Field<?>> newStream = stream.map(r -> r.getValue(0));",
" }",
" try (Stream<Record> stream = rq.fetchStream()) {",
" Stream<Field<?>> newStream = stream.map(r -> r.getValue(0));",
" }",
" }",
"}")
.doTest();
}

@Test
public void test_fix() {
refactoringValidator
Expand Down
6 changes: 1 addition & 5 deletions baseline-refaster-rules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand All @@ -39,4 +35,4 @@ moduleJvmArgs {
'jdk.compiler/com.sun.tools.javac.util'
]
opens = ['jdk.compiler/com.sun.tools.javac.comp']
}
}
6 changes: 1 addition & 5 deletions baseline-refaster-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,4 +42,4 @@ moduleJvmArgs {
'jdk.compiler/com.sun.tools.javac.tree',
'jdk.compiler/com.sun.tools.javac.util'
]
}
}
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ allprojects {
check("PreconditionsConstantMessage", CheckSeverity.OFF)
}
}
tasks.withType(Test) {
useJUnitPlatform {
includeEngines 'junit-vintage', 'junit-jupiter'
}
}
}

apply plugin: 'org.inferred.processors'
Expand Down
10 changes: 5 additions & 5 deletions versions.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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