Skip to content

Commit 057bc98

Browse files
gnodetclaude
andcommitted
chore(ci): advise manual IT runs for excluded modules
When changed modules have associated integration tests that are excluded from CI (e.g. camel-jbang-core → camel-jbang-it), post a PR comment advising the contributor to run them manually. The mapping is maintained in manual-it-mapping.txt, co-located with the incremental build script. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 27f4a64 commit 057bc98

3 files changed

Lines changed: 86 additions & 0 deletions

File tree

.github/CI-ARCHITECTURE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ The core test runner. Determines which modules to test using:
8686
Results are merged, deduplicated, and tested. The script also:
8787
- Detects tests disabled in CI (`@DisabledIfSystemProperty(named = "ci.env.name")`)
8888
- Applies an exclusion list for generated/meta modules
89+
- Checks for excluded modules with associated integration tests (via
90+
`manual-it-mapping.txt`) and advises contributors to run them manually
8991
- Generates a unified PR comment with all test information
9092

9193
### `install-mvnd`
@@ -141,6 +143,29 @@ properties change. A future improvement could use
141143
[Scalpel](https://github.com/maveniverse/scalpel) to resolve the full
142144
dependency graph and detect all affected modules.
143145

146+
## Manual Integration Test Advisories
147+
148+
Some modules are excluded from CI's `-amd` expansion (the `EXCLUSION_LIST`)
149+
because they are generated code, meta-modules, or expensive integration test
150+
suites. When a contributor changes one of these modules, CI cannot automatically
151+
test all downstream effects.
152+
153+
The file `manual-it-mapping.txt` (co-located with the incremental build script)
154+
maps source modules to their associated integration test suites. When a changed
155+
module has a mapping entry, CI posts an advisory in the PR comment:
156+
157+
> You modified `dsl/camel-jbang/camel-jbang-core`. The related integration
158+
> tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider
159+
> running them manually:
160+
> ```
161+
> mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
162+
> ```
163+
164+
To add new mappings, edit `manual-it-mapping.txt` using the format:
165+
```
166+
source-artifact-id:it-module-path:command
167+
```
168+
144169
## Multi-JDK Artifact Behavior
145170
146171
All non-experimental JDK matrix entries (17, 21) upload the CI comment

.github/actions/incremental-build/incremental-build.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,49 @@ detectDisabledTests() {
215215
fi
216216
}
217217

218+
# Check if changed modules have associated integration tests excluded from CI.
219+
# Reads manual-it-mapping.txt and appends advisories to the PR comment.
220+
checkManualItTests() {
221+
local final_pl="$1"
222+
local comment_file="$2"
223+
local script_dir
224+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
225+
local mapping_file="${script_dir}/manual-it-mapping.txt"
226+
227+
[[ ! -f "$mapping_file" ]] && return
228+
229+
declare -A it_commands
230+
declare -A it_sources
231+
232+
while IFS=: read -r source_id it_module command; do
233+
# Skip comments and empty lines
234+
[[ -z "$source_id" || "$source_id" == \#* ]] && continue
235+
source_id="${source_id// /}"
236+
it_module="${it_module// /}"
237+
command="${command#"${command%%[![:space:]]*}"}"
238+
239+
# Check if any module in final_pl matches this source_id
240+
for module_path in $(echo "$final_pl" | tr ',' '\n'); do
241+
if [[ "$(basename "$module_path")" == "$source_id" ]]; then
242+
it_commands["$it_module"]="$command"
243+
it_sources["$it_module"]="${it_sources[$it_module]:-}${it_sources[$it_module]:+, }\`${module_path}\`"
244+
fi
245+
done
246+
done < "$mapping_file"
247+
248+
if [[ ${#it_sources[@]} -gt 0 ]]; then
249+
echo "" >> "$comment_file"
250+
echo ":bulb: **Manual integration tests recommended:**" >> "$comment_file"
251+
for it_module in "${!it_sources[@]}"; do
252+
echo "" >> "$comment_file"
253+
echo "> You modified ${it_sources[$it_module]}. The related integration tests in \`${it_module}\` are excluded from CI. Consider running them manually:" >> "$comment_file"
254+
echo '> ```' >> "$comment_file"
255+
echo "> ${it_commands[$it_module]}" >> "$comment_file"
256+
echo '> ```' >> "$comment_file"
257+
done
258+
fi
259+
}
260+
218261
# ── Comment generation ─────────────────────────────────────────────────
219262

220263
writeComment() {
@@ -512,6 +555,9 @@ main() {
512555
echo "$disabled_tests" >> "$comment_file"
513556
fi
514557

558+
# Check for excluded IT suites that should be run manually
559+
checkManualItTests "$final_pl" "$comment_file"
560+
515561
# Append reactor module list from build log
516562
if [[ -f "$log" ]]; then
517563
local reactor_modules
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Manual integration test mapping
2+
#
3+
# Maps source modules (excluded from CI -amd expansion) to their
4+
# associated integration test suites that must be run manually.
5+
#
6+
# Format: source-artifact-id : it-module-path : command
7+
#
8+
# JBang integration tests
9+
camel-jbang-core:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
10+
camel-jbang-main:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
11+
camel-jbang-plugin-generate:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
12+
camel-jbang-plugin-edit:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
13+
camel-jbang-plugin-kubernetes:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
14+
camel-jbang-plugin-test:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
15+
camel-launcher:dsl/camel-jbang/camel-jbang-it:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test

0 commit comments

Comments
 (0)