Skip to content
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 @@ -98,7 +98,7 @@
eclipse.classpath.plusConfigurations = [project.configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME)]

IdeaModel idea = project.extensions.getByType(IdeaModel)
idea.module.testSourceDirs += testSourceSet.java.srcDirs
idea.module.testSources.from(testSourceSet.java.srcDirs)

Check warning on line 101 in buildSrc/src/main/groovy/org/opensearch/gradle/test/StandaloneRestTestPlugin.groovy

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/groovy/org/opensearch/gradle/test/StandaloneRestTestPlugin.groovy#L101

Added line #L101 was not covered by tests
idea.module.scopes.put('TEST', [plus: [project.configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME)]] as Map<String, Collection<Configuration>>)

PrecommitTasks.create(project, false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
import org.gradle.api.tasks.testing.Test;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;

import javax.inject.Inject;

Expand Down Expand Up @@ -97,20 +96,13 @@
this.project = project;
}

@Inject
protected Factory<PatternSet> getPatternSetFactory() {
throw new UnsupportedOperationException();
}

@Input
public Map<String, Set<File>> getClassFilesPerEnabledTask() {
return project.getTasks().withType(Test.class).stream().filter(Task::getEnabled).collect(Collectors.toMap(Task::getPath, task -> {
// See please https://docs.gradle.org/8.1/userguide/upgrading_version_8.html#test_task_default_classpath
final JvmTestSuite jvmTestSuite = JvmTestSuiteHelper.getDefaultTestSuite(project).orElse(null);
if (jvmTestSuite != null) {
final PatternFilterable patternSet = getPatternSetFactory().create()
.include(task.getIncludes())
.exclude(task.getExcludes());
final PatternFilterable patternSet = new PatternSet().include(task.getIncludes()).exclude(task.getExcludes());

Check warning on line 105 in buildSrc/src/main/java/org/opensearch/gradle/precommit/TestingConventionsTasks.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/precommit/TestingConventionsTasks.java#L105

Added line #L105 was not covered by tests

final Set<File> files = jvmTestSuite.getSources()
.getOutput()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;

import javax.inject.Inject;

Expand Down Expand Up @@ -86,15 +85,10 @@
@Inject
public CopyRestApiTask(Project project) {
this.project = project;
this.corePatternSet = getPatternSetFactory().create();
this.corePatternSet = new PatternSet();

Check warning on line 88 in buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestApiTask.java#L88

Added line #L88 was not covered by tests
this.includeCore = project.getObjects().listProperty(String.class);
}

@Inject
protected Factory<PatternSet> getPatternSetFactory() {
throw new UnsupportedOperationException();
}

@Inject
protected FileSystemOperations getFileSystemOperations() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.util.PatternFilterable;
import org.gradle.api.tasks.util.PatternSet;
import org.gradle.internal.Factory;

import javax.inject.Inject;

Expand Down Expand Up @@ -83,15 +82,10 @@
@Inject
public CopyRestTestsTask(Project project) {
this.project = project;
this.corePatternSet = getPatternSetFactory().create();
this.corePatternSet = new PatternSet();

Check warning on line 85 in buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/test/rest/CopyRestTestsTask.java#L85

Added line #L85 was not covered by tests
this.includeCore = project.getObjects().listProperty(String.class);
}

@Inject
protected Factory<PatternSet> getPatternSetFactory() {
throw new UnsupportedOperationException();
}

@Inject
protected FileSystemOperations getFileSystemOperations() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
Configuration runtimeClasspathConfiguration = project.getConfigurations().getByName(runtimeClasspathName);
project.getPluginManager().withPlugin("idea", p -> {
IdeaModel idea = project.getExtensions().getByType(IdeaModel.class);
idea.getModule().setTestSourceDirs(testSourceSet.getJava().getSrcDirs());
idea.getModule().getTestSources().setFrom(testSourceSet.getJava().getSrcDirs());

Check warning on line 179 in buildSrc/src/main/java/org/opensearch/gradle/util/GradleUtils.java

View check run for this annotation

Codecov / codecov/patch

buildSrc/src/main/java/org/opensearch/gradle/util/GradleUtils.java#L179

Added line #L179 was not covered by tests
idea.getModule().getScopes().put(testSourceSet.getName(), new HashMap<String, Collection<Configuration>>() {
{
put("plus", Arrays.asList(runtimeClasspathConfiguration));
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=fba8464465835e74f7270bbf43d6d8a8d7709ab0a43ce1aa3323f73e9aa0c612
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
Loading