You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hop.apache.org by ha...@apache.org on 2020/12/06 15:24:43 UTC

[incubator-hop] 01/22: HOP-2212 (#436)

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

hansva pushed a commit to branch integration-tests
in repository https://gitbox.apache.org/repos/asf/incubator-hop.git

commit 3f0bcca9e8245b3a4c4954381c94a2f783c51032
Author: Hans Van Akelyen <ha...@gmail.com>
AuthorDate: Sat Dec 5 15:51:05 2020 +0100

    HOP-2212 (#436)
    
    * add initial integration tests to hop
    
    * HOP-2212
---
 Jenkinsfile.daily                      | 43 +++++++++++-----------------------
 integration-tests/scripts/run-tests.sh | 10 +++-----
 2 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/Jenkinsfile.daily b/Jenkinsfile.daily
index cce1854..6f47d31 100644
--- a/Jenkinsfile.daily
+++ b/Jenkinsfile.daily
@@ -36,8 +36,6 @@ pipeline {
 
     environment {
         MAVEN_SKIP_RC = true
-        dockerImage = ''
-        imagename = 'hop'
     }
 
     options {
@@ -70,36 +68,19 @@ pipeline {
                 checkout scm
             }
         }
-        stage('Build & Test') {
+        stage('Build') {
             when {
                 branch 'integration-tests'
             }
             steps {
-                echo 'Build & Test'
-                sh "mvn $MAVEN_PARAMS clean install"
-            }
-        }
-        // stage('Code Quality') {
-        //     steps {
-        //         echo 'Checking Code Quality on SonarCloud'
-        //         withCredentials([string(credentialsId: 'sonarcloud-key-apache-hop', variable: 'SONAR_TOKEN')]) {
-        //             sh 'mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-hop -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
-        //         }
-        //     }
-        // }
-        stage('Create Docker image'){
-            steps {
-                script {
-                    dockerImage = docker.build -f 'Dockerfile.unit-tests' imagename
+                echo 'Build'
+
+                dir("local-snapshots-dir/") {
+                    deleteDir()
                 }
+
+                sh "mvn $MAVEN_PARAMS clean install"
             }
-        }
-        stage('Run Integration Tests'){
-            steps {
-                script {
-                    echo 'Run tests'
-                }
-            }            
             post {
                 always {
                     junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
@@ -107,9 +88,13 @@ pipeline {
                 }
             }
         }
-        stage('Remove docker image'){
-            sh "docker rmi $iamgename:$BUILD_NUMBER"
-            sh "docker rmi $iamgename:latest"
+        stage('Code Quality') {
+            steps {
+                echo 'Checking Code Quality on SonarCloud'
+                withCredentials([string(credentialsId: 'sonarcloud-key-apache-hop', variable: 'SONAR_TOKEN')]) {
+                    sh 'mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=apache -Dsonar.projectKey=apache_incubator-hop -Dsonar.branch.name=${BRANCH_NAME} -Dsonar.login=${SONAR_TOKEN}'
+                }
+            }
         }
         
 
diff --git a/integration-tests/scripts/run-tests.sh b/integration-tests/scripts/run-tests.sh
index c584214..28df867 100755
--- a/integration-tests/scripts/run-tests.sh
+++ b/integration-tests/scripts/run-tests.sh
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
-
 if [ -z "${HOP_LOCATION}" ]; then
     HOP_LOCATION=/opt/hop
 fi
@@ -14,8 +12,10 @@ skipped_counter=0
 failures_counter=0
 spacer="==========================================="
 
+#cleanup surefire report
+/dev/null > /tmp/testcases
 
-for d in $current_dir/../*/ ; do
+for d in ../*/ ; do
     if [[ "$d" != *"scripts/" ]]; then
 
         test_name=$(basename $d)
@@ -98,7 +98,3 @@ echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >> /tmp/surefire_report.xml
 echo "<testsuite xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report-3.0.xsd\" version=\"3.0\" name=\"Hop Integration Tests\" time=\"$total_duration\" tests=\"$test_counter\" errors=\"$errors_counter\" skipped=\"$skipped_counter\" failures=\"$failures_counter\">" >> /tmp/surefire_report.xml
 cat /tmp/testcases >> /tmp/surefire_report.xml
 echo "</testsuite>" >> /tmp/surefire_report.xml
-
-#Copy final report back
-mkdir -p $current_dir/../surefire-reports/
-cp /tmp/surefire_report.xml $current_dir/../surefire-reports/report.xml