ammachado commented on code in PR #24665: URL: https://github.com/apache/camel/pull/24665#discussion_r3581411831
########## dsl/camel-jbang/camel-launcher/src/test/java/org/apache/camel/dsl/jbang/launcher/CamelLauncherWindowsExeIT.java: ########## @@ -0,0 +1,72 @@ +/* + * 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.apache.camel.dsl.jbang.launcher; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; +import org.junit.jupiter.api.condition.EnabledOnOs; +import org.junit.jupiter.api.condition.OS; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Release gate for the native {@code camel.exe} packaged into the launcher distribution. Runs during {@code verify} + * when {@code -Dcamel.launcher.requireWindowsExe=true} is set on a Windows x64 host. + */ +@EnabledOnOs(OS.WINDOWS) +@EnabledIfSystemProperty(named = "camel.launcher.requireWindowsExe", matches = "true") +class CamelLauncherWindowsExeIT { + + private static final Path TARGET = Paths.get("target"); + private static final Path STAGED_EXE = TARGET.resolve("camel.exe"); + + @Test + void stagedCamelExeExists() { + assertTrue(Files.isRegularFile(STAGED_EXE), + "target/camel.exe must be present before packaging the launcher distribution"); + } + + @Test + void binArchiveIncludesCamelExe() throws IOException { Review Comment: Good catch, same root cause as the CI assertion bug, fixed in f76de4f1c0e3 (suffix match instead of exact `bin/camel.exe` lookup, since `includeBaseDirectory` defaults to `true` in the assembly descriptor). While digging into this I found a bigger gap worth flagging: the official release pipeline (`Jenkinsfile.deploy`) runs on `ubuntu`, and `build-windows-exe` / `include-camel-exe` only activate via `<os><family>windows</family>`. Neither `camel.exe.requireWindowsExe` nor `camel.launcher.requireWindowsExe` is set anywhere in that pipeline, so on an actual release the native compile is skipped, the `camel.exe` fileSet in `bin.xml` matches nothing, and the released `camel-launcher-*-bin.zip` ships without `camel.exe`, no error, just silently missing. That would break the Winget packaging from the other PR. @davsclaus since you know the release process better than I do: is there already a place a Windows-hosted build step could hook into (e.g. a separate agent on the release Jenkins job), or should this be a post-release GitHub Actions job that builds the Windows artifact and uploads it alongside the rest of the release? Happy to put a PR together once there's a direction. _Claude Code on behalf of @ammachado_ _AI-generated review, so it may get things wrong. Please check any suggestion before you act on it._ -- 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]
