Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6806de4892
|
||
|
|
a9d51ebd47 | ||
|
|
284c69aa3e
|
||
|
|
fb30d9acc5
|
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
@@ -164,7 +164,7 @@
|
||||
"on": {
|
||||
"push": {
|
||||
"branches": [
|
||||
"**"
|
||||
"main"
|
||||
]
|
||||
},
|
||||
"pull_request": {
|
||||
|
||||
@@ -51,7 +51,8 @@ class SpecialistNativeTests(unittest.TestCase):
|
||||
self.assertEqual(steps[3], original['jobs']['build-and-test']['steps'][3])
|
||||
self.assertEqual(steps[4]['if'], 'always()')
|
||||
caller = bridge.canonical('mcp-rag', SHA)
|
||||
self.assertEqual(caller['on']['push'], {'branches': ['**']})
|
||||
# Feature branches run once through the PR event, not also on push.
|
||||
self.assertEqual(caller['on']['push'], {'branches': ['main']})
|
||||
self.assertEqual(caller['on']['pull_request'], {'branches': ['main']})
|
||||
self.assertEqual(caller['jobs']['validate']['secrets'], {
|
||||
'QQQ_MCP_VOYAGE_API_KEY': '${{ secrets.QQQ_MCP_VOYAGE_API_KEY }}'})
|
||||
|
||||
@@ -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()
|
||||
@@ -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'
|
||||
Reference in new issue
Block a user