This repository has been archived on 2026-11-08. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
qqq-orb/tests/test_maven_ci_cache.sh
james.maesandOpenAI Codex 26b0a3a18b feat: centralize QQQ pipeline profiles and release coordination [minor]
Own canonical consumer validation, selective workflow generation, Maven caching and RC completion in the shared orb. Centralize native workers and preserve acceptance/publication contracts with packed-output, behavioral and estate-audit tests.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Signed-off-by: James Maes <james@kof22.com>
2026-10-20 06:35:13 -05:00

39 lines
1.9 KiB
Bash

#!/bin/bash
# Run with bash; uses only Python, Git and a temporary repository (no network/Maven).
set -euo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../src/scripts" && pwd)
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
cd "$scratch"
git init -q
mkdir -p module/nested .mvn/wrapper
printf '<project><version>1</version></project>\n' > pom.xml
printf '<project><dependency>one</dependency></project>\n' > module/pom.xml
printf '<project/>\n' > module/nested/pom.xml
printf 'distributionUrl=https://example.invalid/maven.zip\n' > .mvn/wrapper/maven-wrapper.properties
printf 'class Example {}\n' > module/Example.java
git add .
export MAVEN_CACHE_FINGERPRINT_FILE="$scratch/fingerprint"
fingerprint() { bash "$script_dir/maven_cache_fingerprint.sh" || return; cat "$MAVEN_CACHE_FINGERPRINT_FILE"; }
original=$(fingerprint)
[[ "$original" == "$(fingerprint)" ]]
printf 'class Example { int changed; }\n' > module/Example.java
[[ "$original" == "$(fingerprint)" ]] # source-only edits reuse dependencies
printf '<project><dependency>two</dependency></project>\n' > module/pom.xml
module_change=$(fingerprint)
[[ "$original" != "$module_change" ]] # root POM unchanged
printf '<project><version>2</version></project>\n' > module/nested/pom.xml
nested_change=$(fingerprint)
[[ "$module_change" != "$nested_change" ]]
printf 'distributionUrl=https://example.invalid/new.zip\n' > .mvn/wrapper/maven-wrapper.properties
[[ "$nested_change" != "$(fingerprint)" ]]
# Maven runs from child directories must fingerprint the same complete reactor.
root_hash=$(fingerprint)
cd module
[[ "$root_hash" == "$(fingerprint)" ]]
cd ..
# Deleting a tracked input fails closed, rather than silently sharing the old key.
rm module/pom.xml
if fingerprint >/dev/null 2>&1; then echo 'missing tracked POM accepted' >&2; exit 1; fi
printf 'PASS: stable, multi-module, wrapper, subdirectory and missing-input fingerprints\n'