Compare commits

...
4 Commits
Author SHA1 Message Date
james.maes 9c30a30754 Merge pull request #33 from QRun-IO/develop
release: promote Maven reporting and publication fixes
2026-10-20 19:23:39 -05:00
james.maes a9d51ebd47 Merge pull request #32 from QRun-IO/fix/integration-test-results
fix: preserve Maven reports and publication completion
2026-10-20 19:21:25 -05:00
james.maesandCodex 284c69aa3e fix: allow Central publication wait to finish
Co-Authored-By: Codex <noreply@openai.com>
2026-10-20 19:18:31 -05:00
james.maesandCodex fb30d9acc5 fix: retain integration and multi-module test reports
Co-Authored-By: Codex <noreply@openai.com>
2026-10-20 19:16:27 -05:00
6 changed files with 59 additions and 24 deletions

No files matched your search

+1
View File
@@ -72,6 +72,7 @@ jobs:
bash tests/test_maven_ci_push.sh
bash tests/test_create_github_release.sh
bash tests/test_maven_ci_cache.sh
bash tests/test_maven_test_results.sh
bash tests/test_maven_ci_install.sh
bash tests/test_snapshot_refresh.sh
bash tests/test_maven_settings_output.sh
+1
View File
@@ -81,6 +81,7 @@ test-pipelines: pack
bash tests/test_maven_ci_push.sh
bash tests/test_create_github_release.sh
bash tests/test_maven_ci_cache.sh
bash tests/test_maven_test_results.sh
bash tests/test_maven_ci_install.sh
bash tests/test_snapshot_refresh.sh
bash tests/test_maven_settings_output.sh
+3
View File
@@ -14,6 +14,9 @@ steps:
command: <<include(scripts/mvn_jar_deploy_gpg_setup.sh)>>
- run:
name: Publish to Sonatype Central (releases and SNAPSHOTs)
# Central's native publication wait can be silent for its 30-minute limit.
# Let Maven return its real result before CircleCI's inactivity watchdog.
no_output_timeout: 35m
command: <<include(scripts/mvn_jar_deploy.sh)>>
- save_cache:
paths:
+8 -24
View File
@@ -1,26 +1,10 @@
#!/bin/bash
# Collect unit and integration JUnit reports without losing same-named module suites.
set -euo pipefail
############################################################################
## mvn_verify_save_test_results.sh
## Test Results Collection Script
##
## This script collects JUnit test results from Maven Surefire reports
## and saves them to the CircleCI test results directory for reporting.
## It finds all XML test result files and copies them to the standard location.
##
## Process:
## 1. Creates test results directory structure
## 2. Finds all Surefire XML report files
## 3. Copies test results to CircleCI test results directory
##
## Usage: Called by CircleCI orb command mvn_verify
## Output: Collects and saves JUnit test results for CircleCI reporting
############################################################################
set -e
#############################################################
## Create test results directory and collect JUnit reports ##
#############################################################
mkdir -p ~/test-results/junit/
find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \;
mkdir -p "$HOME/test-results/junit"
while IFS= read -r -d '' report; do
destination="$HOME/test-results/junit/${report#./}"
mkdir -p "$(dirname "$destination")"
cp "$report" "$destination"
done < <(find . -type f \( -path '*/target/surefire-reports/TEST-*.xml' -o -path '*/target/failsafe-reports/TEST-*.xml' \) -print0)
+11
View File
@@ -63,6 +63,17 @@ class MavenCiContract(unittest.TestCase):
self.assertIn("-Dgpg.keyname=", deploy)
self.assertIn("-DskipTests", deploy)
def test_publication_wait_outlives_central_native_timeout(self):
steps = read("src/commands/mvn_jar_deploy.yml")["steps"]
publish = next(s["run"] for s in steps if "mvn_jar_deploy.sh" in str(s))
# Central 0.8.x waits silently up to 1800 seconds; the default Circle
# ten-minute inactivity limit killed an already-uploaded RC in production.
timeout = publish["no_output_timeout"]
self.assertTrue(timeout.endswith("m"))
self.assertGreater(int(timeout[:-1]), 30)
self.assertLessEqual(int(timeout[:-1]), 40)
self.assertNotIn("max_auto_reruns", publish)
if __name__ == "__main__":
unittest.main()
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
# Exercise the actual collector with colliding suites, spaces and non-JUnit XML.
set -euo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")/../src/scripts" && pwd)
scratch=$(mktemp -d)
trap 'rm -rf "$scratch"' EXIT
export HOME="$scratch/home"
mkdir -p "$scratch/repo"
cd "$scratch/repo"
# A repository with no tests is valid.
bash "$script_dir/mvn_verify_save_test_results.sh"
[[ -d "$HOME/test-results/junit" ]]
[[ -z "$(find "$HOME/test-results/junit" -type f -print)" ]]
for module in 'module one' 'module two'; do
for runner in surefire failsafe; do
report="$module/target/$runner-reports/TEST-shared.xml"
mkdir -p "$(dirname "$report")"
printf '<testsuite name="%s %s"/>\n' "$module" "$runner" > "$report"
done
done
printf '<failsafe-summary/>\n' > 'module one/target/failsafe-reports/failsafe-summary.xml'
printf '<configuration/>\n' > 'module one/target/surefire-reports/configuration.xml'
mkdir -p unrelated
printf '<testsuite/>\n' > unrelated/TEST-ignore.xml
bash "$script_dir/mvn_verify_save_test_results.sh"
[[ "$(find "$HOME/test-results/junit" -type f | wc -l)" -eq 4 ]]
for module in 'module one' 'module two'; do
for runner in surefire failsafe; do
report="$module/target/$runner-reports/TEST-shared.xml"
cmp "$report" "$HOME/test-results/junit/$report"
done
done
printf 'PASS: unit/integration reports, module collisions, spaces, exclusions and no tests\n'