Skip to content

Commit

Permalink
More testing
Browse files Browse the repository at this point in the history
  • Loading branch information
brianseeders committed May 8, 2024
1 parent 60a38ad commit d26bad9
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 36 deletions.
Expand Up @@ -73,6 +73,10 @@ public static void setupYamlRestTestDependenciesDefaults(Project project, Source
if (useNewTestClusters) {
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), project.project(":test:test-clusters"));
}

project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.vintage:junit-vintage-engine:5.8.1");
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.platform:junit-platform-launcher:1.8.1");
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.jupiter:junit-jupiter:5.8.1");
}
}

Expand All @@ -86,5 +90,9 @@ public static void setupJavaRestTestDependenciesDefaults(Project project, Source
if (yamlTestRunnerProject != null) {
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), yamlTestRunnerProject);
}

project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.vintage:junit-vintage-engine:5.8.1");
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.platform:junit-platform-launcher:1.8.1");
project.getDependencies().add(sourceSet.getImplementationConfigurationName(), "org.junit.jupiter:junit-jupiter:5.8.1");
}
}
18 changes: 9 additions & 9 deletions build-tools/build.gradle
Expand Up @@ -166,16 +166,16 @@ tasks.withType(JavaCompile).configureEach {
options.incremental = System.getenv("JENKINS_URL") == null && System.getenv("BUILDKITE_BUILD_URL") == null && System.getProperty("isCI") == null
}

test {
useJUnitPlatform {
includeEngines 'junit-vintage'
}
// test {
// useJUnitPlatform {
// includeEngines 'junit-vintage'
// }

// distribution {
// enabled = true
// maxLocalExecutors = 0
// }
}
// // distribution {
// // enabled = true
// // maxLocalExecutors = 0
// // }
// }

// tasks.register("integTest", Test) {
// testClassesDirs = sourceSets.integTest.output.classesDirs
Expand Down
12 changes: 11 additions & 1 deletion build.gradle
Expand Up @@ -16,6 +16,7 @@ import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.internal.BaseInternalPluginBuildPlugin
import org.elasticsearch.gradle.internal.ResolveAllDependencies
import org.elasticsearch.gradle.internal.info.BuildParams
import org.elasticsearch.gradle.test.YamlRestTestPlugin
import org.elasticsearch.gradle.util.GradleUtils
import org.gradle.plugins.ide.eclipse.model.AccessRule
import org.gradle.plugins.ide.eclipse.model.ProjectDependency
Expand Down Expand Up @@ -338,8 +339,17 @@ allprojects {
}

apply plugin: 'elasticsearch.formatting'
}

['yamlRestTest', 'javaRestTest'].each { taskName ->
maybeConfigure(project.tasks, taskName) {
it.useJUnitPlatform()
it.distribution {
enabled = true
maxLocalExecutors = 0
}
}
}
}

tasks.register("verifyBwcTestsEnabled") {
doLast {
Expand Down
52 changes: 26 additions & 26 deletions modules/analysis-common/build.gradle
Expand Up @@ -32,9 +32,9 @@ dependencies {
testImplementation "org.junit.platform:junit-platform-launcher:1.8.1"
testImplementation "org.junit.jupiter:junit-jupiter:5.8.1"

yamlRestTestImplementation "org.junit.vintage:junit-vintage-engine:5.8.1"
yamlRestTestImplementation "org.junit.platform:junit-platform-launcher:1.8.1"
yamlRestTestImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
// yamlRestTestImplementation "org.junit.vintage:junit-vintage-engine:5.8.1"
// yamlRestTestImplementation "org.junit.platform:junit-platform-launcher:1.8.1"
// yamlRestTestImplementation "org.junit.jupiter:junit-jupiter:5.8.1"
}

tasks.named("yamlRestTestV7CompatTransform").configure { task ->
Expand All @@ -44,31 +44,31 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
task.skipTest("search.query/50_queries_with_synonyms/Test common terms query with stacked tokens", "#42654 - `common` query throws an exception")
}

test {
useJUnitPlatform()
// test {
// useJUnitPlatform()

// useJUnitPlatform {
// includeEngines 'junit-vintage'
// }
// // useJUnitPlatform {
// // includeEngines 'junit-vintage'
// // }

distribution {
enabled = true
maxLocalExecutors = 0
}
// javaLauncher = javaToolchains.launcherFor {
// languageVersion = JavaLanguageVersion.of(18)
// }
}
// distribution {
// enabled = true
// maxLocalExecutors = 0
// }
// // javaLauncher = javaToolchains.launcherFor {
// // languageVersion = JavaLanguageVersion.of(18)
// // }
// }

tasks.named('yamlRestTest').configure {
testLogging {
outputs.upToDateWhen {false}
showStandardStreams = true
}
useJUnitPlatform()
distribution {
enabled = true
maxLocalExecutors = 0
}
javaLauncher = javaToolchains.launcherFor { }
// testLogging {
// outputs.upToDateWhen {false}
// showStandardStreams = true
// }
// useJUnitPlatform()
// distribution {
// enabled = true
// maxLocalExecutors = 0
// }
// javaLauncher = javaToolchains.launcherFor { }
}

0 comments on commit d26bad9

Please sign in to comment.