From ba7209f4ad36948fb037b1067e98f9811252980e Mon Sep 17 00:00:00 2001 From: Martin Desruisseaux Date: Mon, 10 Nov 2025 17:16:47 +0100 Subject: [PATCH] Remove the integration test for MCOMPILER-346. It was testing a workaround for an issue which was fixed in Java 15. Since Maven 4 requires Java 17 or later, workaround is not needed anymore (unless toolchains or forked compilers are used). Furthermore, the actual fix was in Plexus Compiler, which is not used anymore by the Maven plugin. Finally, the test was expecting a build failure with an error message that tends to vary between different versions of Maven Core, because the errors seem to be sometime detected earlier during dependencies collection. https://github.com/apache/maven-compiler-plugin/issues/554 --- src/it/CHANGES_v3_to_v4.md | 1 + src/it/MCOMPILER-346/invoker.properties | 19 -- src/it/MCOMPILER-346/pom.xml | 59 ----- .../server/PooledJenkinsController.java | 209 ------------------ src/it/MCOMPILER-346/verify.groovy | 34 --- 5 files changed, 1 insertion(+), 321 deletions(-) delete mode 100644 src/it/MCOMPILER-346/invoker.properties delete mode 100644 src/it/MCOMPILER-346/pom.xml delete mode 100644 src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java delete mode 100644 src/it/MCOMPILER-346/verify.groovy diff --git a/src/it/CHANGES_v3_to_v4.md b/src/it/CHANGES_v3_to_v4.md index ccb229514..1687e41c3 100644 --- a/src/it/CHANGES_v3_to_v4.md +++ b/src/it/CHANGES_v3_to_v4.md @@ -51,6 +51,7 @@ To reproduce the old behavior, users can just disable the incremental compilatio The tests in the following directories were already disabled and have been removed: * `MCOMPILER-197` because it ran only on Java 8 while the build now requires Java 17. +* `MCOMPILER-346` because it tests an issue fixed in Java 15 while the build now requires Java 17. * `groovy-project-with-new-plexus-compiler` because it ran only on Java 8 and the plexus compiler has been removed. The tests in the following directores are not supported anymore and have been removed: diff --git a/src/it/MCOMPILER-346/invoker.properties b/src/it/MCOMPILER-346/invoker.properties deleted file mode 100644 index 965cfab67..000000000 --- a/src/it/MCOMPILER-346/invoker.properties +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -invoker.goals = clean compile -invoker.buildResult = failure diff --git a/src/it/MCOMPILER-346/pom.xml b/src/it/MCOMPILER-346/pom.xml deleted file mode 100644 index 2dccb817c..000000000 --- a/src/it/MCOMPILER-346/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - 4.0.0 - - org.apache.maven.plugins.compiler.it - MCOMPILER-346-mre - 1.0 - jar - MCOMPILER-346 Minimal Reproducible Example (MRE) - https://github.com/basil/MCOMPILER-346-mre - - UTF-8 - - - - org.eclipse.sisu - org.eclipse.sisu.plexus - 0.2.0 - - - org.jenkins-ci.main - remoting - 3.2 - - - - - repo.jenkins-ci.org - https://repo.jenkins-ci.org/public/ - - - - - - org.apache.maven.plugins - maven-compiler-plugin - @project.version@ - - - - diff --git a/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java b/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java deleted file mode 100644 index 06706f90b..000000000 --- a/src/it/MCOMPILER-346/src/main/java/org/jenkinsci/test/acceptance/server/PooledJenkinsController.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.jenkinsci.test.acceptance.server; - -import javax.inject.Inject; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.Executors; - -import com.cloudbees.sdk.extensibility.Extension; -import com.google.inject.Injector; -import hudson.remoting.Callable; -import hudson.remoting.Channel; -import hudson.remoting.Channel.Mode; -import hudson.remoting.ChannelBuilder; -import jnr.unixsocket.UnixSocketAddress; -import jnr.unixsocket.UnixSocketChannel; -import org.jenkinsci.remoting.RoleChecker; -import org.jenkinsci.test.acceptance.controller.IJenkinsController; -import org.jenkinsci.test.acceptance.controller.JenkinsController; -import org.jenkinsci.test.acceptance.controller.LocalController.LocalFactoryImpl; -import org.jenkinsci.test.acceptance.log.LogListenable; -import org.jenkinsci.test.acceptance.log.LogListener; -import org.jenkinsci.test.acceptance.log.LogSplitter; - -import static java.lang.System.*; - -/** - * {@link JenkinsController} that talks to {@link JenkinsControllerPoolProcess} over Unix domain socket. - * - * @author Kohsuke Kawaguchi - */ -public class PooledJenkinsController extends JenkinsController implements LogListenable { - private URL url; - private final File socket; - private UnixSocketChannel conn; - private final LogSplitter splitter = new LogSplitter(); - private Channel channel; - private IJenkinsController controller; - private final List toUnpack = new LinkedList<>(); - - public PooledJenkinsController(Injector i, File socket) { - super(i); - this.socket = socket; - } - - @Override - public void addLogListener(LogListener l) { - splitter.addLogListener(l); - } - - @Override - public void removeLogListener(LogListener l) { - splitter.removeLogListener(l); - } - - private boolean connect() throws IOException { - if (conn != null) return false; - - System.out.println("Requesting jut instance using socket " + socket.getAbsolutePath()); - UnixSocketAddress address = new UnixSocketAddress(socket); - conn = UnixSocketChannel.open(address); - - channel = new ChannelBuilder("JenkinsPool", Executors.newCachedThreadPool()) - .withMode(Mode.BINARY) - .build(ChannelStream.in(conn), ChannelStream.out(conn)); - - try { - controller = (IJenkinsController) channel.waitForRemoteProperty("controller"); - controller.start(); - url = controller.getUrl(); - - if (!isQuite) { - splitter.addLogListener(getLogPrinter()); - } - - final LogListener l = channel.export(LogListener.class, splitter); - channel.call(new InstallLogger(controller, l)); - - for (byte[] content : toUnpack) { - controller.populateJenkinsHome(content, false); - } - toUnpack.clear(); - } catch (InterruptedException e) { - throw new IOException(e); - } - - return true; - } - - @Override - public void startNow() throws IOException { - connect(); - } - - @Override - public void stopNow() throws IOException { - controller.stop(); - } - - @Override - public void populateJenkinsHome(byte[] template, boolean clean) throws IOException { - if (controller != null) { - controller.populateJenkinsHome(template, clean); - } else { - if (clean) { - throw new UnsupportedOperationException("clean mode unsupported for now"); - } - toUnpack.add(template); - } - } - - @Override - public URL getUrl() { - if (url == null) throw new IllegalStateException("This controller has not been started"); - return url; - } - - @Override - public void tearDown() throws IOException { - channel.close(); - try { - channel.join(3000); - } catch (InterruptedException e) { - throw new IOException(e); - } finally { - if (conn != null) conn.close(); - conn = null; - } - } - - @Override - public void diagnose(Throwable cause) { - // TODO: Report jenkins log - cause.printStackTrace(out); - if (getenv("INTERACTIVE") != null && getenv("INTERACTIVE").equals("true")) { - out.println("Commencing interactive debugging. Browser session was kept open."); - out.println("Press return to proceed."); - try { - in.read(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - } - - @Extension - public static class FactoryImpl extends LocalFactoryImpl { - @Inject - Injector i; - - @Override - public String getId() { - return "pool"; - } - - @Override - public JenkinsController create() { - return i.getInstance(PooledJenkinsController.class); - } - } - - /** - * Runs on the pool server to install logger. - */ - private static class InstallLogger implements Callable { - private final IJenkinsController controller; - private final LogListener l; - - private InstallLogger(IJenkinsController controller, LogListener l) { - this.controller = controller; - this.l = l; - } - - @Override - public Void call() throws IOException { - if (controller instanceof LogListenable) { - LogListenable ll = (LogListenable) controller; - ll.addLogListener(l); - } - return null; - } - - @Override - public void checkRoles(RoleChecker checker) throws SecurityException {} - - private static final long serialVersionUID = 1L; - } -} diff --git a/src/it/MCOMPILER-346/verify.groovy b/src/it/MCOMPILER-346/verify.groovy deleted file mode 100644 index 9c4e0f102..000000000 --- a/src/it/MCOMPILER-346/verify.groovy +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -def logFile = new File( basedir, 'build.log' ) -assert logFile.exists() -content = logFile.text - -/* - * The messages expected by this test were: - * - * - package org.jenkinsci.test.acceptance.controller does not exist - * - package org.jenkinsci.test.acceptance.log does not exist - * - * But we cannot test the full messages as shown above because they may be localized. - * Test only the package name on the assumption that they will be present in all locales. - */ -assert content.contains( 'org.jenkinsci.test.acceptance.controller' ) -assert content.contains( 'org.jenkinsci.test.acceptance.log' )