gnodet commented on code in PR #1655: URL: https://github.com/apache/maven-mvnd/pull/1655#discussion_r3741212758
########## integration-tests/src/test/java/org/mvndaemon/mvnd/it/ReactorPluginDescriptorReloadTest.java: ########## @@ -0,0 +1,84 @@ +/* + * 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.mvndaemon.mvnd.it; + +import javax.inject.Inject; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mvndaemon.mvnd.assertj.TestClientOutput; +import org.mvndaemon.mvnd.client.Client; +import org.mvndaemon.mvnd.client.DaemonParameters; +import org.mvndaemon.mvnd.junit.MvndNativeTest; +import org.mvndaemon.mvnd.junit.TestUtils; + +/** + * Reproduces the case where a reactor plugin is rebuilt between two daemon invocations without being installed + * (so it is resolved as a {@code target/classes} directory). The plugin descriptor (e.g. parameter default values, + * the {@code threadSafe} flag, ...) is cached independently from the plugin realm and must be evicted as well, + * otherwise the daemon keeps serving the stale descriptor. See + * <a href="https://github.com/apache/maven-mvnd/issues/877">#877</a>. Review Comment: This links to [#877](https://github.com/apache/maven-mvnd/issues/877) (Jansi native library loading on Synology NAS), but this PR fixes [#1555](https://github.com/apache/maven-mvnd/issues/1555) (reactor plugins not reloaded). The PR title and body correctly reference #1555. ########## integration-tests/src/test/java/org/mvndaemon/mvnd/it/ReactorPluginDescriptorReloadTest.java: ########## @@ -0,0 +1,84 @@ +/* + * 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.mvndaemon.mvnd.it; + +import javax.inject.Inject; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.mvndaemon.mvnd.assertj.TestClientOutput; +import org.mvndaemon.mvnd.client.Client; +import org.mvndaemon.mvnd.client.DaemonParameters; +import org.mvndaemon.mvnd.junit.MvndNativeTest; +import org.mvndaemon.mvnd.junit.TestUtils; + +/** + * Reproduces the case where a reactor plugin is rebuilt between two daemon invocations without being installed + * (so it is resolved as a {@code target/classes} directory). The plugin descriptor (e.g. parameter default values, + * the {@code threadSafe} flag, ...) is cached independently from the plugin realm and must be evicted as well, + * otherwise the daemon keeps serving the stale descriptor. See + * <a href="https://github.com/apache/maven-mvnd/issues/877">#877</a>. + */ +@MvndNativeTest(projectDir = "src/test/projects/module-and-plugin") Review Comment: **Naming convention:** All 17 existing `@MvndNativeTest`-annotated classes use the `*NativeIT` suffix (e.g., `ModuleAndPluginNativeIT`). The closely related `ModuleAndPluginNativeIT.java` uses the same `projectDir` and follows this pattern. With the current `*Test` name, Surefire will pick this up during the `test` phase (wrong phase, likely missing native infrastructure), while Failsafe will skip it entirely in the `native` profile. Suggested rename: `ReactorPluginDescriptorReloadNativeIT` A companion `ReactorPluginDescriptorReloadTest` extending it with `@MvndTest` (like `ModuleAndPluginTest` extends `ModuleAndPluginNativeIT`) would complete the pattern. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
