You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by li...@apache.org on 2021/01/15 04:17:31 UTC

[dubbo-samples] branch master updated: Add case versions (#262)

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

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git


The following commit(s) were added to refs/heads/master by this push:
     new f523abc  Add case versions (#262)
f523abc is described below

commit f523abc3a1f9529bf1f9577abf6fa5568d318c4f
Author: gongdewei <ky...@qq.com>
AuthorDate: Fri Jan 15 12:17:23 2021 +0800

    Add case versions (#262)
---
 .github/workflows/dubbo-2.yml                     |  7 ++--
 .github/workflows/dubbo-3.yml                     |  5 +--
 .github/workflows/nightly-dubbo-2.yml             | 11 +++--
 .github/workflows/nightly-dubbo-3.yml             | 11 +++--
 dubbo-samples-environment-keys/case-versions.conf |  6 +++
 dubbo-samples-scala/case-versions.conf            |  6 +++
 dubbo-samples-ssl/case-versions.conf              |  6 +++
 dubbo-samples-tengine/case-versions.conf          |  6 +++
 test/build-test-image.sh                          |  2 +-
 test/scripts/add-case-versions.sh                 | 50 +++++++++++++++++++++++
 test/scripts/case-versions.conf.1                 |  6 +++
 test/scripts/case-versions.conf.2                 |  6 +++
 test/scripts/case-versions.conf.3                 |  6 +++
 test/{ => scripts}/clean-damaged-image.sh         |  0
 test/{ => scripts}/merge-test-results.sh          |  6 ++-
 test/{ => scripts}/prepare-test.sh                | 15 ++++---
 16 files changed, 121 insertions(+), 28 deletions(-)

diff --git a/.github/workflows/dubbo-2.yml b/.github/workflows/dubbo-2.yml
index b492683..4f2732d 100644
--- a/.github/workflows/dubbo-2.yml
+++ b/.github/workflows/dubbo-2.yml
@@ -16,7 +16,7 @@ env:
   #multi-version size limit
   VERSIONS_LIMIT: 4
   CANDIDATE_VERSIONS: '
-    dubbo.version:2.7.8,2.7.9-SNAPSHOT;
+    dubbo.version:2.7.9-SNAPSHOT;
     spring.version:4.3.30.RELEASE;
     spring-boot.version:1.5.22.RELEASE;
     spring-boot.version:2.4.1;
@@ -105,8 +105,7 @@ jobs:
       - uses: actions/checkout@v1
       - name: Prepare test list
         run: |
-          cd test
-          bash ./prepare-test.sh
+          bash ./test/scripts/prepare-test.sh
       - name: Upload test list
         uses: actions/upload-artifact@v2
         with:
@@ -132,7 +131,7 @@ jobs:
           name: test-result
           path: test/jobs/
       - name: Merge test result - java ${{matrix.java}}
-        run: ./test/merge-test-results.sh
+        run: ./test/scripts/merge-test-results.sh
 
   testjob_1:
     needs: [prepare_test, build-dubbo]
diff --git a/.github/workflows/dubbo-3.yml b/.github/workflows/dubbo-3.yml
index 776ddf1..a3299d1 100644
--- a/.github/workflows/dubbo-3.yml
+++ b/.github/workflows/dubbo-3.yml
@@ -105,8 +105,7 @@ jobs:
       - uses: actions/checkout@v1
       - name: Prepare test list
         run: |
-          cd test
-          bash ./prepare-test.sh
+          bash ./test/scripts/prepare-test.sh
       - name: Upload test list
         uses: actions/upload-artifact@v2
         with:
@@ -132,7 +131,7 @@ jobs:
           name: test-result
           path: test/jobs/
       - name: Merge test result - java ${{matrix.java}}
-        run: ./test/merge-test-results.sh
+        run: ./test/scripts/merge-test-results.sh
 
   testjob_1:
     needs: [prepare_test, build-dubbo]
diff --git a/.github/workflows/nightly-dubbo-2.yml b/.github/workflows/nightly-dubbo-2.yml
index 018914c..4bb85b3 100644
--- a/.github/workflows/nightly-dubbo-2.yml
+++ b/.github/workflows/nightly-dubbo-2.yml
@@ -21,9 +21,9 @@ env:
   VERSIONS_LIMIT: 12
   CANDIDATE_VERSIONS: '
     dubbo.version: 2.7.8, 2.7.9-SNAPSHOT;
-    spring.version: 4.1.9.RELEASE, 4.2.9.RELEASE, 5.1.20.RELEASE, 5.3.3;
-    spring-boot.version: 1.1.12.RELEASE, 1.2.8.RELEASE, 1.3.8.RELEASE, 1.4.7.RELEASE;
-    spring-boot.version: 2.0.9.RELEASE, 2.1.18.RELEASE, 2.2.12.RELEASE, 2.3.7.RELEASE
+    spring.version: 4.2.9.RELEASE, 4.3.30.RELEASE, 5.1.20.RELEASE, 5.3.3;
+    spring-boot.version: 1.1.12.RELEASE, 1.2.8.RELEASE, 1.3.8.RELEASE, 1.4.7.RELEASE, 1.5.22.RELEASE;
+    spring-boot.version: 2.0.9.RELEASE, 2.1.18.RELEASE, 2.2.12.RELEASE, 2.3.7.RELEASE, 2.4.1
     '
 
 jobs:
@@ -109,8 +109,7 @@ jobs:
       - uses: actions/checkout@v1
       - name: Prepare test list
         run: |
-          cd test
-          bash ./prepare-test.sh
+          bash ./test/scripts/prepare-test.sh
       - name: Upload test list
         uses: actions/upload-artifact@v2
         with:
@@ -136,7 +135,7 @@ jobs:
           name: test-result
           path: test/jobs/
       - name: Merge test result - java ${{matrix.java}}
-        run: ./test/merge-test-results.sh
+        run: ./test/scripts/merge-test-results.sh
 
   testjob_1:
     needs: [prepare_test, build-dubbo]
diff --git a/.github/workflows/nightly-dubbo-3.yml b/.github/workflows/nightly-dubbo-3.yml
index 17ff06e..3020628 100644
--- a/.github/workflows/nightly-dubbo-3.yml
+++ b/.github/workflows/nightly-dubbo-3.yml
@@ -21,9 +21,9 @@ env:
   VERSIONS_LIMIT: 12
   CANDIDATE_VERSIONS: '
     dubbo.version: 3.0.0-SNAPSHOT;
-    spring.version: 4.1.9.RELEASE, 4.2.9.RELEASE, 5.1.20.RELEASE, 5.3.3;
-    spring-boot.version: 1.1.12.RELEASE, 1.2.8.RELEASE, 1.3.8.RELEASE, 1.4.7.RELEASE;
-    spring-boot.version: 2.0.9.RELEASE, 2.1.18.RELEASE, 2.2.12.RELEASE, 2.3.7.RELEASE;
+    spring.version: 4.2.9.RELEASE, 4.3.30.RELEASE, 5.1.20.RELEASE, 5.3.3;
+    spring-boot.version: 1.1.12.RELEASE, 1.2.8.RELEASE, 1.3.8.RELEASE, 1.4.7.RELEASE, 1.5.22.RELEASE;
+    spring-boot.version: 2.0.9.RELEASE, 2.1.18.RELEASE, 2.2.12.RELEASE, 2.3.7.RELEASE, 2.4.1
     '
 
 jobs:
@@ -109,8 +109,7 @@ jobs:
       - uses: actions/checkout@v1
       - name: Prepare test list
         run: |
-          cd test
-          bash ./prepare-test.sh
+          bash ./test/scripts/prepare-test.sh
       - name: Upload test list
         uses: actions/upload-artifact@v2
         with:
@@ -136,7 +135,7 @@ jobs:
           name: test-result
           path: test/jobs/
       - name: Merge test result - java ${{matrix.java}}
-        run: ./test/merge-test-results.sh
+        run: ./test/scripts/merge-test-results.sh
 
   testjob_1:
     needs: [prepare_test, build-dubbo]
diff --git a/dubbo-samples-environment-keys/case-versions.conf b/dubbo-samples-environment-keys/case-versions.conf
new file mode 100644
index 0000000..978f7e7
--- /dev/null
+++ b/dubbo-samples-environment-keys/case-versions.conf
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=2.7*, 3.*
+spring.version=4.*, 5.*
diff --git a/dubbo-samples-scala/case-versions.conf b/dubbo-samples-scala/case-versions.conf
new file mode 100644
index 0000000..978f7e7
--- /dev/null
+++ b/dubbo-samples-scala/case-versions.conf
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=2.7*, 3.*
+spring.version=4.*, 5.*
diff --git a/dubbo-samples-ssl/case-versions.conf b/dubbo-samples-ssl/case-versions.conf
new file mode 100644
index 0000000..978f7e7
--- /dev/null
+++ b/dubbo-samples-ssl/case-versions.conf
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=2.7*, 3.*
+spring.version=4.*, 5.*
diff --git a/dubbo-samples-tengine/case-versions.conf b/dubbo-samples-tengine/case-versions.conf
new file mode 100644
index 0000000..6a96cc8
--- /dev/null
+++ b/dubbo-samples-tengine/case-versions.conf
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# SpringBoot app
+dubbo.version=2.7*, 3.*
+spring-boot.version=2.*
diff --git a/test/build-test-image.sh b/test/build-test-image.sh
index c256915..9e96725 100755
--- a/test/build-test-image.sh
+++ b/test/build-test-image.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Usages:
+# Use mirror:
 # DEBIAN_MIRROR=http://mirrors.aliyun.com ./build-test-image.sh
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
diff --git a/test/scripts/add-case-versions.sh b/test/scripts/add-case-versions.sh
new file mode 100755
index 0000000..338445b
--- /dev/null
+++ b/test/scripts/add-case-versions.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+all_projects=`find $DIR/../.. -name pom.xml`
+project_count=`echo $all_projects | tr ' ' '\n' | grep -c ""`
+echo "Total projects: $project_count"
+
+case_config_template1=$DIR/case-versions.conf.1
+case_config_template2=$DIR/case-versions.conf.2
+case_config_template3=$DIR/case-versions.conf.3
+
+while read project
+do
+#    echo "project: $project"
+    project_dir=`dirname $project`
+    if [ ! -f $project_dir/case-configuration.yml ]; then
+      continue
+    fi
+
+    grep "<spring.version>" $project_dir/pom.xml > /dev/null
+    result=$?
+    if [ $result -eq 0 ]; then
+      case_config_template=$case_config_template1
+    fi
+
+    grep "<spring-boot.version>1" $project_dir/pom.xml > /dev/null
+    result=$?
+    if [ $result -eq 0 ]; then
+      case_config_template=$case_config_template2
+    fi
+
+    grep "<spring-boot.version>2" $project_dir/pom.xml > /dev/null
+    result=$?
+    if [ $result -eq 0 ]; then
+      case_config_template=$case_config_template3
+    fi
+
+    if [ -z $case_config_template ]; then
+      echo "not match: $project_dir"
+      continue
+    fi
+
+    if [ -f $project_dir/case-versions.conf ];then
+      continue
+    fi
+
+    echo "copy $case_config_template to $project_dir"
+    cp -n $case_config_template $project_dir/case-versions.conf
+done <<< "$all_projects"
\ No newline at end of file
diff --git a/test/scripts/case-versions.conf.1 b/test/scripts/case-versions.conf.1
new file mode 100644
index 0000000..978f7e7
--- /dev/null
+++ b/test/scripts/case-versions.conf.1
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# Spring app
+dubbo.version=2.7*, 3.*
+spring.version=4.*, 5.*
diff --git a/test/scripts/case-versions.conf.2 b/test/scripts/case-versions.conf.2
new file mode 100644
index 0000000..f2fe52c
--- /dev/null
+++ b/test/scripts/case-versions.conf.2
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# SpringBoot app
+dubbo.version=2.7*, 3.*
+spring-boot.version=1.*
diff --git a/test/scripts/case-versions.conf.3 b/test/scripts/case-versions.conf.3
new file mode 100644
index 0000000..6a96cc8
--- /dev/null
+++ b/test/scripts/case-versions.conf.3
@@ -0,0 +1,6 @@
+
+# Supported component versions of the test case
+
+# SpringBoot app
+dubbo.version=2.7*, 3.*
+spring-boot.version=2.*
diff --git a/test/clean-damaged-image.sh b/test/scripts/clean-damaged-image.sh
similarity index 100%
rename from test/clean-damaged-image.sh
rename to test/scripts/clean-damaged-image.sh
diff --git a/test/merge-test-results.sh b/test/scripts/merge-test-results.sh
similarity index 94%
rename from test/merge-test-results.sh
rename to test/scripts/merge-test-results.sh
index 084bc26..da7263b 100755
--- a/test/merge-test-results.sh
+++ b/test/scripts/merge-test-results.sh
@@ -1,7 +1,9 @@
 #!/bin/bash
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd $DIR
+
+test_dir=$DIR/..
+cd $test_dir
 
 TEST_SUCCESS="TEST SUCCESS"
 TEST_FAILURE="TEST FAILURE"
@@ -29,7 +31,7 @@ echo "----------------------------------------------------------"
 echo "All tests count: $totalCount"
 echo "Success tests count: $successTest"
 
-if [ $successTest == $totalCount ]; then
+if [ "$successTest" == "$totalCount" ]; then
   if [ $successTest -gt 0 ]; then
     echo "All tests pass"
     echo "----------------------------------------------------------"
diff --git a/test/prepare-test.sh b/test/scripts/prepare-test.sh
similarity index 71%
rename from test/prepare-test.sh
rename to test/scripts/prepare-test.sh
index 0ad20c4..60a4efa 100755
--- a/test/prepare-test.sh
+++ b/test/scripts/prepare-test.sh
@@ -2,20 +2,23 @@
 
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
+test_dir=$DIR/..
+
 JOB_COUNT=${JOB_COUNT:-5}
 echo "JOB_COUNT: $JOB_COUNT"
 
+jobs_dir=$test_dir/jobs
+mkdir -p $jobs_dir
+rm -f $jobs_dir/*
+
 # find all case-configuration.yml
 CONFIG_FILE="case-configuration.yml"
-test_list_file=$DIR/testcases.txt
-test_base_dir="$( cd $DIR/.. && pwd )"
+test_list_file=$jobs_dir/testcases.txt
+test_base_dir="$( cd $test_dir/.. && pwd )"
 echo "Searching all '$CONFIG_FILE' under dir $test_base_dir .."
-find $test_base_dir -name $CONFIG_FILE | grep -v "$DIR" > $test_list_file
+find $test_base_dir -name $CONFIG_FILE | grep -v "$test_dir" > $test_list_file
 
 # Split test list into JOB_COUNT parts
-jobs_dir=$DIR/jobs
-mkdir -p $jobs_dir
-rm -f $jobs_dir/*
 case_index=0
 while read file
 do


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org