Skip to content

Commit 21fd8a9

Browse files
committed
trouble at mill
1 parent 6b2c1ca commit 21fd8a9

File tree

4 files changed

+54
-75
lines changed

4 files changed

+54
-75
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CLAUDE.md
1010
# Symlinks to ignore
1111
CLAUDE.md
1212
json-java21-schema/CLAUDE.md
13+
json-java21-schema/mvn-test-no-boilerplate.sh
1314
WISDOM.md
1415

1516
.vscode/

AGENTS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,20 @@ mvn exec:java -pl json-compatibility-suite -Dexec.args="--json"
218218
- All prohibitions on output filtering apply. Do not pipe logs unless you must constrain an infinite stream, and even then examine a large sample (thousands of lines).
219219
- Remote location of `./mvn-test-no-boilerplate.sh` is the repository root; pass module selectors through it for schema-only runs.
220220

221+
- Preset: Strict schema IT with clean (preferred)
222+
223+
Use the curated preset to clean, run the strict JsonSchemaCheckIT via mvnd -q, and emit CSV metrics.
224+
225+
`./mvn-test-no-boilerplate.sh run_schema_check_with_clean`
226+
227+
Notes:
228+
- Ignores additional CLI parameters and logs that it is using curated defaults.
229+
- Equivalent args: `-pl json-java21-schema -DskipTests=true -DskipITs=false -Dit.test=JsonSchemaCheckIT -Djson.schema.strict=true -Djson.schema.metrics=csv -Djava.util.logging.ConsoleHandler.level=INFO -DfailIfNoTests=false -e -DtrimStackTrace=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.failsafe=debug`
230+
- Writes `json-java21-schema/target/json-schema-compat.csv` and prints DONE/FAILED based on mvn(d) exit code.
231+
232+
- All prohibitions on output filtering apply. Do not pipe logs unless you must constrain an infinite stream, and even then examine a large sample (thousands of lines).
233+
- Remote location of `./mvn-test-no-boilerplate.sh` is the repository root; pass module selectors through it for schema-only runs.
234+
221235
- Strict compatibility sweep with per-file metrics: `./mvn-test-no-boilerplate.sh -pl json-java21-schema -Dit.test=JsonSchemaCheckIT -Djson.schema.strict=true -Djson.schema.metrics=csv -Djava.util.logging.ConsoleHandler.level=INFO`
222236

223237
#### JUL Logging

json-java21-schema/mvn-test-no-boilerplate.sh

Lines changed: 0 additions & 73 deletions
This file was deleted.

mvn-test-no-boilerplate.sh

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
# ./mvn-test-no-boilerplate.sh -pl json-java21-api-tracker -Dtest=CompilerApiLearningTest
1313
#
1414
# The script automatically detects if mvnd is available, otherwise falls back to mvn
15+
# Presets: pass a first arg token to run a curated flow. Currently supported:
16+
# run_schema_check_with_clean
17+
# - Cleans and then verifies only the json-java21-schema IT
18+
# - Runs JsonSchemaCheckIT in strict mode with CSV metrics
19+
# - Uses mvnd -q when available, prints DONE/FAILED based on exit status
1520

1621
# Detect if mvnd is available, otherwise use mvn
1722
if command -v mvnd &> /dev/null; then
@@ -20,9 +25,33 @@ else
2025
MVN_CMD="mvn"
2126
fi
2227

23-
echo "[INFO] Running: $MVN_CMD verify $@"
28+
PRESET="$1"
29+
QUIET_FLAG=""
30+
DO_CLEAN=false
31+
MVN_ARGS=""
2432

25-
timeout 120 $MVN_CMD verify "$@" 2>&1 | awk '
33+
if [ "$PRESET" = "run_schema_check_with_clean" ]; then
34+
DO_CLEAN=true
35+
QUIET_FLAG="-q"
36+
# Ignore all user-supplied args for preset; use curated defaults
37+
echo "[INFO] Preset detected: run_schema_check_with_clean"
38+
echo "[INFO] Ignoring passed parameters; running curated schema IT flow"
39+
MVN_ARGS="-pl json-java21-schema -Dit.test=JsonSchemaCheckIT -Djson.schema.strict=true -Djson.schema.metrics=csv -Djava.util.logging.ConsoleHandler.level=INFO -DfailIfNoTests=false -e -DtrimStackTrace=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.failsafe=debug"
40+
shift # consume preset token
41+
else
42+
# No preset: forward all args as-is
43+
MVN_ARGS="$@"
44+
fi
45+
46+
echo "[INFO] Running: $MVN_CMD ${QUIET_FLAG} generate-test-resources failsafe:integration-test failsafe:verify ${MVN_ARGS}"
47+
48+
set -o pipefail
49+
50+
if $DO_CLEAN; then
51+
timeout 120 $MVN_CMD ${QUIET_FLAG} clean || exit $?
52+
fi
53+
54+
timeout 120 $MVN_CMD ${QUIET_FLAG} generate-test-resources failsafe:integration-test failsafe:verify ${MVN_ARGS} 2>&1 | awk '
2655
BEGIN {
2756
scanning_started = 0
2857
compilation_section = 0
@@ -71,3 +100,11 @@ test_section {
71100
}
72101
}
73102
'
103+
104+
STATUS=${PIPESTATUS[0]}
105+
if [ $STATUS -eq 0 ]; then
106+
echo DONE
107+
else
108+
echo FAILED
109+
fi
110+
exit $STATUS

0 commit comments

Comments
 (0)