You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "luigidemasi (via GitHub)" <gi...@apache.org> on 2026/10/08 14:02:16 UTC

[PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

luigidemasi opened a new pull request, #27578:
URL: https://github.com/apache/camel/pull/27578

   Adds `camel-test-infra-wolf-defender` so the model integration tests can provision their own pinned files. With `-DwolfDefender.download=true`, the service downloads and verifies the model, tokenizer and configuration, then reuses them under `~/.camel-test/wolf-defender/<revision>`. An existing directory supplied through `wolfDefender.modelDirectory` takes precedence and is never modified.
   
   The service uses the test-infra JUnit lifecycle, a cache lock shared across processes, and checksum verification before publishing downloads. Inference still runs locally in the Camel component. Ordinary tests do not download model files, and model tests skip unsupported native platforms before provisioning. The component documentation and generated catalog mirror describe both modes.
   
   This follows #27564 and builds on the platform guard in #27577. The IT now uses a local condition method with a direct Java call to the shared platform check, addressing the string-reference concern raised there.
   
   Validation:
   
   - 10 test-infra tests and 34 component unit tests passed.
   - Both real-model integration tests passed with a fresh download and with existing files.
   - Cached and existing files were verified with network access blocked; architecture-property probes confirmed `ppc64le` and `s390x` skip before cache creation. These probes ran on x86 hardware.
   - Source checks and the full 703-module Camel build passed; full-reactor tests were skipped.
   
   _AI-generated by Codex on behalf of @luigidemasi._
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "luigidemasi (via GitHub)" <gi...@apache.org>.
luigidemasi commented on code in PR #27578:
URL: https://github.com/apache/camel/pull/27578#discussion_r4221162760


##########
test-infra/camel-test-infra-wolf-defender/src/main/java/org/apache/camel/test/infra/wolfdefender/services/WolfDefenderService.java:
##########
@@ -0,0 +1,205 @@
+/*
+ * 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.test.infra.wolfdefender.services;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.nio.channels.FileChannel;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.nio.file.StandardOpenOption;
+import java.security.DigestInputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HexFormat;
+import java.util.Map;
+
+import org.apache.camel.test.infra.common.services.TestService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Supplies the pinned Wolf-Defender model files for local inference tests. */
+public class WolfDefenderService implements TestService {
+    public static final String MODEL_DIRECTORY = "wolfDefender.modelDirectory";
+    public static final String DOWNLOAD = "wolfDefender.download";
+    public static final String CACHE_DIRECTORY = "wolfDefender.cacheDirectory";
+    public static final String MODEL_DIRECTORY_PROPERTY = "wolf-defender.model.directory";

Review Comment:
   Removed it in 1bfe6ee6fe1e. Nothing used the published property; the tests already get the path from `getModelDirectory()`. I also removed the corresponding assertion and README text.
   
   _AI-generated by Codex on behalf of @luigidemasi._
   



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #27578:
URL: https://github.com/apache/camel/pull/27578#issuecomment-6063363494

   @luigidemasi this has merge conflicts


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27578:
URL: https://github.com/apache/camel/pull/27578#issuecomment-6062612069

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-ai/camel-wolf-defender`
   - `test-infra`
   - `test-infra/camel-test-infra-all`
   - `test-infra/camel-test-infra-wolf-defender`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 11 of 703 tested, 3 compile-only — current: 11 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **11 affected modules** (current approach: 11).
   
   **Skip-tests mode would test 11 modules** (4 direct + 0 downstream), **skip tests for 3** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (11)</summary>
   
   - `camel-jbang-mcp` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-jbang-plugin-mcp` ← depends on affected reactor module org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← depends on affected reactor module org.apache.camel:camel-route-parser
   - `camel-jbang-plugin-tui` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-jbang-plugin-validate` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   - `camel-launcher-container` ← depends on affected reactor module org.apache.camel:camel-launcher
   - `camel-test-infra-all` ← own pom test-infra/camel-test-infra-all/pom.xml changed
   - `camel-test-infra-wolf-defender` ← test-infra/camel-test-infra-wolf-defender/README.adoc, test-infra/camel-test-infra-wolf-defender/src/main/java/org/apache/camel/test/infra/wolfdefender/services/WolfDefenderService.java, test-infra/camel-test-infra-wolf-defender/src/test/java/org/apache/camel/test/infra/wolfdefender/services/WolfDefenderServiceTest.java, own pom test-infra/camel-test-infra-wolf-defender/pom.xml changed
   - `camel-wolf-defender` ← components/camel-ai/camel-wolf-defender/src/main/docs/wolf-defender.adoc, components/camel-ai/camel-wolf-defender/src/test/java/org/apache/camel/component/wolfdefender/WolfDefenderModelIT.java, own pom components/camel-ai/camel-wolf-defender/pom.xml changed
   - `camel-yaml-dsl-validator` ← depends on affected reactor module org.apache.camel:camel-catalog
   - `camel-yaml-dsl-validator-maven-plugin` ← depends on affected reactor module org.apache.camel:camel-yaml-dsl-validator
   
   </details>
   
   <details><summary>Modules with tests skipped (3)</summary>
   
   - `camel-itest`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (38 modules, 6m 8s total)</summary>
   
   **Total reactor time:** 6m 8s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 54.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 42.1s | SUCCESS |
   | Camel :: JBang :: MCP | 41.6s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 21.2s | SUCCESS |
   | Camel :: Component DSL | 20.6s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 19.1s | SUCCESS |
   | Camel :: Test Infra :: All test services | 18.0s | SUCCESS |
   | Camel :: YAML DSL | 17.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 15.0s | SUCCESS |
   | Camel :: Docs | 14.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 13.7s | SUCCESS |
   | Camel :: AI :: Wolf-Defender | 12.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 10.0s | SUCCESS |
   | Camel :: Kamelet Main | 9.9s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 8.0s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.7s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 6.1s | SUCCESS |
   | Camel :: Test Infra :: Wolf Defender | 5.6s | SUCCESS |
   | Camel :: All Components Sync point | 5.0s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 4.1s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 3.5s | SUCCESS |
   | Camel :: Catalog :: Maven | 3.0s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.3s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.7s | SUCCESS |
   | Camel :: Assembly | 1.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.4s | SUCCESS |
   | Camel :: Coverage | 1.4s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.3s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
   | Camel :: Catalog :: Console | 0.9s | SUCCESS |
   | Camel :: JBang :: Main | 0.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.9s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 0.7s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.6s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (54.1s)
   - `Camel :: JBang :: Plugin :: TUI` (42.1s)
   - `Camel :: JBang :: MCP` (41.6s)
   - `Camel :: Catalog :: Camel Catalog` (21.2s)
   - `Camel :: Component DSL` (20.6s)
   - `Camel :: YAML DSL :: Validator` (19.1s)
   - `Camel :: Test Infra :: All test services` (18.0s)
   - `Camel :: YAML DSL` (17.4s)
   - `Camel :: JBang :: Plugin :: Validate` (15.0s)
   - `Camel :: Docs` (14.0s)
   - `Camel :: JBang :: Plugin :: Testing` (13.7s)
   - `Camel :: AI :: Wolf-Defender` (12.7s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (10.0s)
   - `Camel :: Kamelet Main` (9.9s)
   - `Camel :: YAML DSL :: Deserializers` (8.0s)
   - `Camel :: Catalog :: Camel Route Parser` (7.7s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (6.1s)
   - `Camel :: Test Infra :: Wolf Defender` (5.6s)
   - `Camel :: All Components Sync point` (5.0s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (4.1s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37789178252)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27578:
URL: https://github.com/apache/camel/pull/27578#issuecomment-6061598346

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27578:
URL: https://github.com/apache/camel/pull/27578#discussion_r4220145271


##########
test-infra/camel-test-infra-wolf-defender/src/main/java/org/apache/camel/test/infra/wolfdefender/services/WolfDefenderService.java:
##########
@@ -0,0 +1,205 @@
+/*
+ * 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.test.infra.wolfdefender.services;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.nio.channels.FileChannel;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.nio.file.StandardOpenOption;
+import java.security.DigestInputStream;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.HexFormat;
+import java.util.Map;
+
+import org.apache.camel.test.infra.common.services.TestService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Supplies the pinned Wolf-Defender model files for local inference tests. */
+public class WolfDefenderService implements TestService {
+    public static final String MODEL_DIRECTORY = "wolfDefender.modelDirectory";
+    public static final String DOWNLOAD = "wolfDefender.download";
+    public static final String CACHE_DIRECTORY = "wolfDefender.cacheDirectory";
+    public static final String MODEL_DIRECTORY_PROPERTY = "wolf-defender.model.directory";

Review Comment:
   Small naming point: the input is `wolfDefender.modelDirectory`, but the resolved path is published as `wolf-defender.model.directory`. Two near-identical names for the same directory are easy to mix up. Could this one use the `wolfDefender.*` style too (e.g. `wolfDefender.resolvedModelDirectory`), or be dropped if nothing reads it yet?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25311: Add Wolf Defender test infrastructure [camel]

Posted by "luigidemasi (via GitHub)" <gi...@apache.org>.
luigidemasi merged PR #27578:
URL: https://github.com/apache/camel/pull/27578


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org