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 @@ -23,7 +23,7 @@ import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.tasks.testing.Test
import org.gradle.api.tasks.Input
import org.gradle.internal.time.Clock
import org.gradle.internal.work.WorkerLeaseRegistry
import org.gradle.internal.work.WorkerLeaseService

public class RepeatTest extends Test {

Expand Down Expand Up @@ -53,7 +53,7 @@ public class RepeatTest extends Test {
super.createTestExecuter().workerFactory,
getActorFactory(),
getModuleRegistry(),
getServices().get(WorkerLeaseRegistry.class),
getServices().get(WorkerLeaseService.class),
getServices().get(StartParameter.class).getMaxWorkerCount(),
getServices().get(Clock.class),
getServices().get(DocumentationRegistry.class),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.gradle.api.internal.tasks.testing.TestResultProcessor;
import org.gradle.api.internal.tasks.testing.TestStartEvent;
import org.gradle.api.internal.tasks.testing.worker.WorkerTestClassProcessor;
import org.gradle.api.tasks.testing.TestFailure;
import org.gradle.api.tasks.testing.TestOutputEvent;

/**
Expand Down Expand Up @@ -68,7 +69,7 @@ public void output(Object testId, TestOutputEvent event) {
}

@Override
public void failure(Object testId, Throwable result) {
public void failure(Object testId, TestFailure result) {
processor.failure(testId, result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
import org.gradle.internal.Factory;
import org.gradle.internal.actor.ActorFactory;
import org.gradle.internal.time.Clock;
import org.gradle.internal.work.WorkerLeaseRegistry;
import org.gradle.internal.work.WorkerLeaseService;
import org.gradle.process.internal.worker.WorkerProcessFactory;

/**
* A copy of {@link DefaultTestExecuter} from Gradle v6.8.3, modified to process each test class
* A copy of {@link DefaultTestExecuter} from Gradle v7.6.6, modified to process each test class
* as many times as it was submitted. This is required by our {@link RepeatTest} task, because:
* <ul>
* <li>Geode's {@code RepeatTest} task operates by submitting each test class for processing
Expand All @@ -71,7 +71,7 @@ public class RepeatTestExecuter implements TestExecuter<JvmTestExecutionSpec> {
private final WorkerProcessFactory workerFactory;
private final ActorFactory actorFactory;
private final ModuleRegistry moduleRegistry;
private final WorkerLeaseRegistry workerLeaseRegistry;
private final WorkerLeaseService workerLeaseService;
private final int maxWorkerCount;
private final Clock clock;
private final DocumentationRegistry documentationRegistry;
Expand All @@ -80,13 +80,13 @@ public class RepeatTestExecuter implements TestExecuter<JvmTestExecutionSpec> {
private TestClassProcessor processor;

public RepeatTestExecuter(WorkerProcessFactory workerFactory, ActorFactory actorFactory,
ModuleRegistry moduleRegistry, WorkerLeaseRegistry workerLeaseRegistry, int maxWorkerCount,
ModuleRegistry moduleRegistry, WorkerLeaseService workerLeaseService, int maxWorkerCount,
Clock clock, DocumentationRegistry documentationRegistry, DefaultTestFilter testFilter,
int iterationCount) {
this.workerFactory = workerFactory;
this.actorFactory = actorFactory;
this.moduleRegistry = moduleRegistry;
this.workerLeaseRegistry = workerLeaseRegistry;
this.workerLeaseService = workerLeaseService;
this.maxWorkerCount = maxWorkerCount;
this.clock = clock;
this.documentationRegistry = documentationRegistry;
Expand All @@ -99,17 +99,14 @@ public void execute(final JvmTestExecutionSpec testExecutionSpec,
TestResultProcessor testResultProcessor) {
final TestFramework testFramework = testExecutionSpec.getTestFramework();
final WorkerTestClassProcessorFactory testInstanceFactory = testFramework.getProcessorFactory();
final WorkerLeaseRegistry.WorkerLease
currentWorkerLease =
workerLeaseRegistry.getCurrentWorkerLease();
final Set<File> classpath = ImmutableSet.copyOf(testExecutionSpec.getClasspath());
final Set<File> modulePath = ImmutableSet.copyOf(testExecutionSpec.getModulePath());
final List<String>
testWorkerImplementationModules =
testFramework.getTestWorkerImplementationModules();
final Factory<TestClassProcessor> forkingProcessorFactory = () -> {
TestClassProcessor forkingTestClassProcessor =
new ForkingTestClassProcessor(currentWorkerLease, workerFactory, testInstanceFactory,
new ForkingTestClassProcessor(workerLeaseService, workerFactory, testInstanceFactory,
testExecutionSpec.getJavaForkOptions(), classpath, modulePath,
testWorkerImplementationModules, testFramework.getWorkerConfigurationAction(),
moduleRegistry, documentationRegistry);
Expand Down Expand Up @@ -139,7 +136,8 @@ public void execute(final JvmTestExecutionSpec testExecutionSpec,
detector = new DefaultTestClassScanner(testClassFiles, null, processor);
}

new TestMainAction(detector, processor, testResultProcessor, clock, testExecutionSpec.getPath(),
new TestMainAction(detector, processor, testResultProcessor, workerLeaseService, clock,
testExecutionSpec.getPath(),
"Gradle Test Run " + testExecutionSpec.getIdentityPath()).run();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec
import org.gradle.api.internal.tasks.testing.TestExecuter
import org.gradle.api.internal.tasks.testing.detection.DefaultTestExecuter
import org.gradle.internal.time.Clock
import org.gradle.internal.work.WorkerLeaseRegistry
import org.gradle.internal.work.WorkerLeaseService

class Executers {
/**
Expand All @@ -48,7 +48,7 @@ class Executers {
workerProcessFactory,
testTask.actorFactory,
testTask.moduleRegistry,
services.get(WorkerLeaseRegistry),
services.get(WorkerLeaseService),
services.get(StartParameter).getMaxWorkerCount(),
services.get(Clock),
services.get(DocumentationRegistry),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Workers {
workerImplementationFactory.gradleUserHomeDir,
workerImplementationFactory.temporaryFileProvider,
donor.execHandleFactory,
workerImplementationFactory.jvmVersionDetector,
donor.jvmVersionDetector,
donor.outputEventListener,
donor.memoryManager,
processLauncher)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ public LauncherProxyWorkerProcessBuilder(WorkerProcessBuilder delegate,

@Override
public WorkerProcessBuilder applicationClasspath(Iterable<File> files) {
return delegate.applicationClasspath(files);
delegate.applicationClasspath(files);
return this;
}

@Override
Expand All @@ -60,7 +61,8 @@ public Set<File> getApplicationClasspath() {

@Override
public WorkerProcessBuilder applicationModulePath(Iterable<File> files) {
return delegate.applicationModulePath(files);
delegate.applicationModulePath(files);
return this;
}

@Override
Expand All @@ -70,7 +72,8 @@ public Set<File> getApplicationModulePath() {

@Override
public WorkerProcessBuilder setBaseName(String baseName) {
return delegate.setBaseName(baseName);
delegate.setBaseName(baseName);
return this;
}

@Override
Expand All @@ -80,12 +83,14 @@ public String getBaseName() {

@Override
public WorkerProcessBuilder setLogLevel(LogLevel logLevel) {
return delegate.setLogLevel(logLevel);
delegate.setLogLevel(logLevel);
return this;
}

@Override
public WorkerProcessBuilder sharedPackages(Iterable<String> packages) {
return delegate.sharedPackages(packages);
delegate.sharedPackages(packages);
return this;
}

@Override
Expand All @@ -105,7 +110,8 @@ public LogLevel getLogLevel() {

@Override
public WorkerProcessBuilder sharedPackages(String... packages) {
return delegate.sharedPackages(packages);
delegate.sharedPackages(packages);
return this;
}

@Override
Expand All @@ -128,6 +134,17 @@ public void enableJvmMemoryInfoPublishing(boolean shouldPublish) {
delegate.enableJvmMemoryInfoPublishing(shouldPublish);
}

/**
* Returns this builder rather than the delegate's return value, because callers chain from this
* method and must continue to hold the wrapper that installs the process launcher.
*/
@SuppressWarnings("deprecation")
@Override
public WorkerProcessBuilder setUseLegacyAddOpens(boolean useLegacyAddOpens) {
delegate.setUseLegacyAddOpens(useLegacyAddOpens);
return this;
}

/**
* Replaces the standard worker process's process launcher with this builder's launcher.
*/
Expand Down
17 changes: 15 additions & 2 deletions build-tools/scripts/src/main/groovy/check-pom.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,22 @@ tasks.register('checkPom') {
}
}

// Renders a node so that sibling elements compare equal regardless of the order the POM
// generator emits them in (for example <groupId> and <artifactId> within an <exclusion>).
// Element order carries no meaning in these blocks, and the comparison below already ignores
// the order of the <dependency> elements themselves.
def canonicalForm
canonicalForm = { node ->
def childNodes = node.children().findAll { it instanceof Node }
if (childNodes.isEmpty()) {
return "${node.name()}=${node.text()}"
}
return "${node.name()}[" + childNodes.collect { canonicalForm(it) }.sort().join(',') + "]"
}

def dependenciesBlocksMatch = { actual, expected ->
def actualTreeSet = actual.dependencies.dependency.collect {it.toString()}.toSet()
def expectedTreeSet = expected.dependencies.dependency.collect {it.toString()}.toSet()
def actualTreeSet = actual.dependencies.dependency.collect {canonicalForm(it)}.toSet()
def expectedTreeSet = expected.dependencies.dependency.collect {canonicalForm(it)}.toSet()
actualTreeSet.equals(expectedTreeSet)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ publishing {
withXml {
def providerAsElement = asElement()
providerAsElement.insertBefore(
providerAsElement.ownerDocument().createComment(apacheLicense),
providerAsElement.getOwnerDocument().createComment(apacheLicense),
providerAsElement.firstChild)
}
}
Expand Down
1 change: 1 addition & 0 deletions build-tools/scripts/src/main/groovy/geode-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ gradle.taskGraph.whenReady({ graph ->
if (project.hasProperty('testJVMVer') && testJVMVer.toInteger() >= 9) {
jvmArgs += [
"--add-opens=java.base/java.io=ALL-UNNAMED",
"--add-opens=java.base/java.lang=ALL-UNNAMED",
"--add-opens=java.base/java.lang.annotation=ALL-UNNAMED",
"--add-opens=java.base/java.lang.module=ALL-UNNAMED",
"--add-opens=java.base/java.lang.ref=ALL-UNNAMED",
Expand Down
35 changes: 6 additions & 29 deletions geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -417,26 +417,6 @@ tasks.register('gfshDepsJar', Jar) {
}
}

// Extract legacy Tomcat 6 jars needed only to satisfy Javadoc for old session manager classes
// (LifecycleSupport, SerializablePrincipal) without altering runtime dependencies.
def legacyTomcatDir = "$buildDir/legacyTomcat"
tasks.register('extractLegacyTomcatForJavadoc') {
description = 'Extracts legacy Tomcat catalina jars for Javadoc symbol resolution.'
outputs.dir(legacyTomcatDir)
dependsOn configurations.webServerTomcat6
doLast {
delete legacyTomcatDir
copy {
from { zipTree(configurations.webServerTomcat6.singleFile) }
// Include the full Tomcat 6 lib set so packages like org.apache.catalina.ha.session
// (SerializablePrincipal) and util.LifecycleSupport are present. We keep it scoped
// to Javadoc only via this extracted directory rather than adding runtime deps.
include '**/lib/*.jar'
into legacyTomcatDir
}
}
}

tasks.register('docs', Javadoc) {
def docsDir = file("$buildDir/javadocs")
// Removed -Xwerror to avoid treating HTML5 compatibility warnings as errors
Expand All @@ -448,8 +428,10 @@ tasks.register('docs', Javadoc) {

// Do NOT add the javadocStubs sources directly; we only want them on the classpath, not in output.

// Only aggregate projects that actually compile Java sources. Platform (BOM) projects appear
// on the javadocOnly configuration but have no source sets or 'classes' task to depend on.
def docProjects = getDependencyProjectsFor('javadocOnly').findAll { proj ->
proj.hasProperty('sourceSets')
proj.pluginManager.hasPlugin('java')
}

// Ensure compilation is done before aggregating docs
Expand All @@ -474,16 +456,11 @@ tasks.register('docs', Javadoc) {

// Use javadocOnly configuration with transitive dependencies to get external libraries
// This avoids cross-project configuration resolution while including necessary dependencies
// Include legacy Tomcat jars for symbol resolution of older session manager classes
dependsOn(tasks.named('extractLegacyTomcatForJavadoc'))
// Use a lazy FileCollection for legacy Tomcat jars so extraction runs before it is resolved
// Broaden legacy Tomcat inclusion (Option 2) to all jars in Tomcat6 lib so that
// org.apache.catalina.util.LifecycleSupport and org.apache.catalina.ha.session.SerializablePrincipal
// (present in clustering/ha related jars) are available to Javadoc without excluding sources.
def legacyCatalinaJars = files { fileTree(legacyTomcatDir).matching { include '*.jar' } }
// The javadocStubs output supplies the older session manager symbols
// (org.apache.catalina.util.LifecycleSupport, org.apache.catalina.ha.session.SerializablePrincipal)
// that are absent from the Tomcat version on the javadocOnly configuration.
classpath = configurations.javadocOnly +
files(docProjects.collect { proj -> proj.sourceSets.main.output }) +
legacyCatalinaJars +
sourceSets.javadocStubs.output

options.addStringOption('Xwerror','-quiet')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void testBasicGradleBuild() {
copyDirectoryResource(projectDir, buildDir);

GradleConnector connector = GradleConnector.newConnector();
connector.useGradleVersion("7.3.3");
connector.useGradleVersion("7.6.6");
connector.forProjectDirectory(buildDir);

ProjectConnection connection = connector.connect();
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ buildId = 0
productName = Apache Geode
productOrg = Apache Software Foundation (ASF)

minimumGradleVersion = 7.3.3
minimumGradleVersion = 7.6.6
# Set this on the command line with -P or in ~/.gradle/gradle.properties
# to change the buildDir location. Use an absolute path.
buildRoot=
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.6-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading