You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2022/06/05 10:42:37 UTC

[archiva] branch master-jenkinsfile-it-test updated (b11edf305 -> 96b04bc79)

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

olamy pushed a change to branch master-jenkinsfile-it-test
in repository https://gitbox.apache.org/repos/asf/archiva.git


 discard b11edf305 Add missing function
 discard 54b4711fc run directly IT test instead of a separate file
     add 7b8dbaff5 move version properties in child or it is complicated to sync and prevent dependabot working
     new a66d46eb9 run directly IT test instead of a separate file
     new 96b04bc79 Add missing function

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b11edf305)
            \
             N -- N -- N   refs/heads/master-jenkinsfile-it-test (96b04bc79)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 pom.xml | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)


[archiva] 02/02: Add missing function

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch master-jenkinsfile-it-test
in repository https://gitbox.apache.org/repos/asf/archiva.git

commit 96b04bc79fe8deb3ebdebf9f660cd9c698a7ed25
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Sun Jun 5 17:05:31 2022 +1000

    Add missing function
    
    Signed-off-by: Olivier Lamy <ol...@apache.org>
---
 Jenkinsfile | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
index 495a75d71..b9905a7c9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -271,4 +271,28 @@ pipeline {
     }
 }
 
+// Send a notification about the build status
+def notifyBuild(String buildStatus) {
+    // default the value
+    buildStatus = buildStatus ?: "UNKNOWN"
+
+    def email = "notifications@archiva.apache.org"
+    def summary = "${env.JOB_NAME}#${env.BUILD_NUMBER} - ${buildStatus} - ${currentBuild?.currentResult}"
+    def detail = """<h4>Job: <a href='${env.JOB_URL}'>${env.JOB_NAME}</a> [#${env.BUILD_NUMBER}]</h4>
+  <p><b>${buildStatus}</b></p>
+  <table>
+    <tr><td>Build</td><td><a href='${env.BUILD_URL}'>${env.BUILD_URL}</a></td><tr>
+    <tr><td>Console</td><td><a href='${env.BUILD_URL}console'>${env.BUILD_URL}console</a></td><tr>
+    <tr><td>Test Report</td><td><a href='${env.BUILD_URL}testReport/'>${env.BUILD_URL}testReport/</a></td><tr>
+  </table>
+  """
+
+    emailext(
+            to: email,
+            subject: summary,
+            body: detail,
+            mimeType: 'text/html'
+    )
+}
+
 // vim: et:ts=4:sw=4:ft=groovy


[archiva] 01/02: run directly IT test instead of a separate file

Posted by ol...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

olamy pushed a commit to branch master-jenkinsfile-it-test
in repository https://gitbox.apache.org/repos/asf/archiva.git

commit a66d46eb97db0adaaaa97c0b69ef1b9a7c6c8238
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Fri Jun 3 21:21:42 2022 +1000

    run directly IT test instead of a separate file
    
    Signed-off-by: Olivier Lamy <ol...@apache.org>
---
 Jenkinsfile | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 93 insertions(+), 6 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 14e5537d9..495a75d71 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -54,7 +54,7 @@ pipeline {
     }
     options {
         disableConcurrentBuilds()
-        buildDiscarder(logRotator(numToKeepStr: '7', artifactNumToKeepStr: '2'))
+        buildDiscarder(logRotator(numToKeepStr: '7', artifactNumToKeepStr: '1'))
     }
     parameters {
         booleanParam(name: 'PRECLEANUP', defaultValue: false, description: 'Clears the local maven repository before build.')
@@ -121,16 +121,103 @@ pipeline {
             }
         }
 
+        stage('Test htmlunit') {
+            steps {
+                timeout(120) {
+                    withMaven(maven: buildMvn, jdk: buildJdk,
+                            mavenSettingsConfig: deploySettings,
+                            mavenLocalRepo: localRepository,
+                            publisherStrategy: 'EXPLICIT',
+                            options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
+                                      findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
+                                      invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
+                                      junitPublisher(disabled: true, ignoreAttachments: false),
+                                      openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
+                    )
+                            {
+                                sh "chmod 755 ./src/ci/scripts/prepareWorkspace.sh"
+                                sh "./src/ci/scripts/prepareWorkspace.sh -d '.repository'"
+                                // Needs a lot of time to reload the repository files, try without cleanup
+                                // Not sure, but maybe
+                                // sh "rm -rf .repository"
 
+                                // Run test phase / ignore test failures
+                                // -B: Batch mode
+                                // -U: Force snapshot update
+                                // -e: Produce execution error messages
+                                // -fae: Fail at the end
+                                // -Dmaven.compiler.fork=true: Compile in a separate forked process
+                                // -Pci-server: Profile for CI-Server
+                                // -Pit-js: Run the selenium test
+                                sh "mvn clean verify -B -V -U -e -fae -DmaxWaitTimeInMs=2000 -Pci-server -Pit-js -DtrimStackTrace=false -Djava.io.tmpdir=.tmp -pl :archiva-webapp-test"
 
-        stage('Postbuild') {
-            parallel {
-                stage('IntegrationTest') {
-                    steps {
-                        build(job: "${INTEGRATION_PIPELINE}/archiva/${env.BRANCH_NAME}", propagate: false, quietPeriod: 5, wait: false)
+                            }
+                }
+            }
+            post {
+                always {
+                    junit testResults: '**/target/failsafe-reports/TEST-*.xml'
+                }
+                failure {
+                    notifyBuild("Failure in Htmlunit test stage")
+                }
+            }
+        }
+
+        // Uses a docker container that is started by script. Maybe we could use the docker functionality
+        // of the jenkins pipeline in the future.
+        stage('Test chrome') {
+            steps {
+                timeout(120) {
+                    withCredentials([[$class : 'UsernamePasswordMultiBinding', credentialsId: DOCKERHUB_CREDS,
+                                      usernameVariable: 'DOCKER_HUB_USER', passwordVariable: 'DOCKER_HUB_PW']]) {
+                        withMaven(maven: buildMvn, jdk: buildJdk,
+                                mavenSettingsConfig: deploySettings,
+                                mavenLocalRepo: localRepository,
+                                publisherStrategy: 'EXPLICIT',
+                                options: [concordionPublisher(disabled: true), dependenciesFingerprintPublisher(disabled: true),
+                                          findbugsPublisher(disabled: true), artifactsPublisher(disabled: true),
+                                          invokerPublisher(disabled: true), jgivenPublisher(disabled: true),
+                                          junitPublisher(disabled: true, ignoreAttachments: false),
+                                          openTasksPublisher(disabled: true), pipelineGraphPublisher(disabled: true)]
+                        )
+                                {
+                                    sh "chmod 755 ./src/ci/scripts/prepareWorkspace.sh"
+                                    sh "./src/ci/scripts/prepareWorkspace.sh"
+                                    sh "chmod 755 src/ci/scripts/container_webtest.sh"
+                                    sh "src/ci/scripts/container_webtest.sh start"
+                                    // Needs a lot of time to reload the repository files, try without cleanup
+                                    // Not sure, but maybe
+                                    // sh "rm -rf .repository"
+
+                                    // Run test phase / ignore test failures
+                                    // -B: Batch mode
+                                    // -U: Force snapshot update
+                                    // -e: Produce execution error messages
+                                    // -fae: Fail at the end
+                                    // -Pci-server: Profile for CI Server
+                                    // -Pit-js: Runs the Selenium tests
+                                    // -Pchrome: Activates the Selenium Chrome Test Agent
+                                    sh "mvn clean verify -B -V -e -fae -DmaxWaitTimeInMs=2000 -DseleniumRemote=true -Pci-server -Pit-js -Pchrome -pl :archiva-webapp-test -DtrimStackTrace=false"
+                                }
                     }
                 }
+            }
+            post {
+                always {
+                    sh "src/ci/scripts/container_webtest.sh stop"
+                    junit testResults: '**/target/failsafe-reports/TEST-*.xml'
+                }
+                failure {
+                    notifyBuild("Failure in Chrome test stage")
+                }
+            }
+        }
+
+
 
+        stage('Postbuild') {
+            parallel {
                 stage('JDK11') {
                     environment {
                         ARCHIVA_USER_CONFIG_FILE = '/tmp/archiva-master-jdk-11-${env.JOB_NAME}.xml'