This is an automated email from the ASF dual-hosted git repository.

benweidig pushed a commit to branch javax
in repository https://gitbox.apache.org/repos/asf/tapestry-5.git

commit eab2906ed7fb4d4d533ab45085cda51beb0f5d30
Author: Ben Weidig <[email protected]>
AuthorDate: Sun Apr 19 12:01:58 2026 +0200

    TAP5-2819: Jenkinsfile improved
    
    Reduced code-duplication, added documentation.
---
 Jenkinsfile                      | 39 ++++++++++++++++--------------
 Jenkinsfile.integration-variants | 51 +++++++++++++++-------------------------
 2 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index cd28d6309..3e65cf090 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -20,7 +20,14 @@ pipeline {
                     }
                 }
 
-                agent { node { label 'ubuntu' } }
+                agent {
+                    node {
+                        label 'ubuntu'
+                        // Use cell-based workspaces.
+                        // This shouldn't be needed, but we had some weird 
matrix issues.
+                        customWorkspace 
"workspace/${env.JOB_NAME}-${JDK_VERSION}"
+                    }
+                }
 
                 tools {
                     jdk "${JDK_VERSION}"
@@ -40,37 +47,33 @@ pipeline {
 
                     stage('Test: Check') {
                         steps {
-                            // This will run unit tests and the default 
integration variant (jQuery + RequireJS).
-                            // We include the coverage report in this step, as 
modifying the test results with
-                            // sed would trigger a test rerun if it would be 
its own stage.
+                            // This will run unit tests (JUnit & TestNG) and 
the default integration variant (jQuery + RequireJS).
                             sh './gradlew check combinedJacocoReport 
--continue'
                         }
                         post {
                             always {
-                                // Prefix the JUnit classnames so the Test UI 
shows which JDK ran which test
-                                sh """
-                                    find . -path 
'*/build/test-results/test/*.xml' \
-                                           -not -path './matrix-artifacts/*' 
-exec \
-                                        sed -i 
's/classname="/classname="${JDK_VERSION}./g' {} +
-                                """
-
+                                // JUnit namespaces automatically on matrix 
cells
                                 junit(
-                                    testResults: 
'**/build/test-results/test/**/*.xml',
+                                    testResults: 
'**/build/test-results/**/*.xml',
                                     allowEmptyResults: true
                                 )
 
-                                // Copy reports into a JDK-named folder to 
avoid overwriting between matrix cells
+                                // archiveArtifacts has no per-cell 
namespacing in matrix builds,
+                                // so we copy into a JDK-labelled folder first 
to avoid cells
+                                // overwriting each other's reports in the 
artifact store.
                                 sh """
-                                    find . \\( -path '*/build/reports' -o 
-path '*/build/test-results' \\) -type d | while IFS= read -r src; do
-                                        
dest="matrix-artifacts/${JDK_VERSION}/\${src#./}"
+                                    find . \\( -path '*/build/reports' -o 
-path '*/build/test-results' \\) \
+                                        -not -path '*/matrix-artifacts/*' 
-type d | while read -r src; do
+                                        
dest="build/matrix-artifacts/${JDK_VERSION}/\${src#./}"
                                         mkdir -p -- "\$dest"
                                         cp -r -- "\$src/." "\$dest/"
                                     done
                                 """
 
                                 archiveArtifacts(
-                                    artifacts: 
"matrix-artifacts/${JDK_VERSION}/**/*",
-                                    allowEmptyArchive: true
+                                    artifacts: 
"build/matrix-artifacts/${JDK_VERSION}/**/*",
+                                    allowEmptyArchive: true,
+                                    fingerprint: false
                                 )
                             }
                         }
@@ -138,7 +141,7 @@ ${getChangeLog()}
 -----------------------------------------------------------
 TEST RESULTS
 -----------------------------------------------------------
-\${TEST_COUNTS, var="total"} Tests: \${TEST_COUNTS, var="pass"} Passed, 
\${TEST_COUNTS, var="fail"} Failed, \${TEST_COUNTS, var="skipped"} Skipped
+\${TEST_COUNTS, var="total"} Tests: \${TEST_COUNTS, var="pass"} Passed, 
\${TEST_COUNTS, var="fail"} Failed, \${TEST_COUNTS, var="skip"} Skipped
 
 -----------------------------------------------------------
 FAILED TESTS (if any)
diff --git a/Jenkinsfile.integration-variants b/Jenkinsfile.integration-variants
index 360434c3b..18786ec9f 100644
--- a/Jenkinsfile.integration-variants
+++ b/Jenkinsfile.integration-variants
@@ -5,7 +5,7 @@ pipeline {
 
     environment {
         // Disable the daemon to prevent parallal issues
-        GRADLE_OPTS = '-Dci=true -Dfile.encoding=UTF-8 
-Dorg.gradle.daemon=false'
+        GRADLE_OPTS = '-Dci=true -Dfile.encoding=UTF-8 
-Dselenium.wait.timeout=60 -Dorg.gradle.daemon=false'
     }
 
     tools {
@@ -13,7 +13,7 @@ pipeline {
     }
 
     options {
-        timeout(time: 1, unit: 'HOURS')
+        timeout(time: 2, unit: 'HOURS')
         skipStagesAfterUnstable()
     }
 
@@ -31,16 +31,7 @@ pipeline {
                     }
                     post {
                         always {
-                            sh '''
-                                if [ -d 
"tapestry-core/build/test-results/testWithPrototypeAndRequireJsDisabled" ]; then
-                                    find 
tapestry-core/build/test-results/testWithPrototypeAndRequireJsDisabled -name 
"*.xml" -type f -exec sed -i 's/classname="/classname="Prototype./g' {} +
-                                fi
-                            '''
-
-                            junit(
-                                testResults: 
'tapestry-core/build/test-results/testWithPrototypeAndRequireJsDisabled/**/*.xml',
-                                allowEmptyResults: true
-                            )
+                            
prefixAndPublishTestResults('testWithPrototypeAndRequireJsDisabled', 
'Prototype')
                         }
                     }
                 }
@@ -56,16 +47,7 @@ pipeline {
                     }
                     post {
                         always {
-                        sh '''
-                                if [ -d 
"tapestry-core/build/test-results/testWithJqueryAndRequireJsDisabled" ]; then
-                                    find 
tapestry-core/build/test-results/testWithJqueryAndRequireJsDisabled -name 
"*.xml" -type f -exec sed -i 's/classname="/classname="Jquery./g' {} +
-                                fi
-                            '''
-
-                            junit(
-                                testResults: 
'tapestry-core/build/test-results/testWithJqueryAndRequireJsDisabled/**/*.xml',
-                                allowEmptyResults: true
-                            )
+                            
prefixAndPublishTestResults('testWithJqueryAndRequireJsDisabled', 'jQuery')
                         }
                     }
                 }
@@ -81,16 +63,7 @@ pipeline {
                     }
                     post {
                         always {
-                            sh '''
-                                if [ -d 
"tapestry-core/build/test-results/testWithPrototypeAndRequireJsEnabled" ]; then
-                                    find 
tapestry-core/build/test-results/testWithPrototypeAndRequireJsEnabled -name 
"*.xml" -type f -exec sed -i 's/classname="/classname="PrototypeRjs./g' {} +
-                                fi
-                            '''
-
-                            junit(
-                                testResults: 
'tapestry-core/build/test-results/testWithPrototypeAndRequireJsEnabled/**/*.xml',
-                                allowEmptyResults: true
-                            )
+                            
prefixAndPublishTestResults('testWithPrototypeAndRequireJsEnabled', 
'PrototypeRjs')
                         }
                     }
                 }
@@ -106,6 +79,20 @@ pipeline {
     }
 }
 
+// TEST RESULTS
+
+def prefixAndPublishTestResults(testName, prefix) {
+    sh """
+        if [ -d "tapestry-core/build/test-results/${testName}" ]; then
+            find tapestry-core/build/test-results/${testName} -name "*.xml" 
-type f -exec sed -i 's/classname="org[.]/classname="${prefix}.org./g' {} +
+        fi
+    """
+    junit(
+        testResults: "tapestry-core/build/test-results/${testName}/**/*.xml",
+        allowEmptyResults: true
+    )
+}
+
 // MAIL NOTIFICATIONS
 
 def getChangeLog() {

Reply via email to