All of lore.kernel.org
 help / color / mirror / Atom feed
* [qa-tools][PATCH] Full-test-cycle-wrapper: Add support for point releases
@ 2017-05-16 18:46 jose.perez.carranza
  0 siblings, 0 replies; only message in thread
From: jose.perez.carranza @ 2017-05-16 18:46 UTC (permalink / raw)
  To: yocto

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add support to scenarios were a execution is needed for branch different
from master, delete lsb-joule environment as is not supported and add
logic to do the “Testopia connection” modular and reusable by other
scripts.

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 scripts/full-test-cycle-wrapper.sh | 16 +++++++++++---
 testopia_update.py                 | 44 ++++++++++++++++++++++++--------------
 2 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/scripts/full-test-cycle-wrapper.sh b/scripts/full-test-cycle-wrapper.sh
index 2b3a130..7dcd62e 100755
--- a/scripts/full-test-cycle-wrapper.sh
+++ b/scripts/full-test-cycle-wrapper.sh
@@ -51,6 +51,13 @@ create_test_run(){
       OPT="-o $2"
    fi
 
+#If point release is used then milestone is not asigned
+   if [[ $MILESTONE == M* ]]; then
+      BUILD_MILESTONE="$VERSION $MILESTONE"
+   else
+      BUILD_MILESTONE="$VERSION$MILESTONE"
+   fi
+
    #echo "############ CREATING TEST RUNS FOR - $1 - #############"
    for ENV in "${ENVIRONMENTS[@]}"
    do
@@ -61,7 +68,7 @@ create_test_run(){
      do
         #call the script that creates Test Runs
         ./testopia_update.py --config $CONFIG_FILE -a $ACTION -p "${1}" -c $EXTP -b $BRANCH \
-        -e "$ENV"  --project-version $VERSION --project-milestone "$VERSION $MILESTONE" \
+        -e "$ENV"  --project-version $VERSION --project-milestone "$BUILD_MILESTONE" \
         --project-date $PJDATE --project-revision $RELEASE-$REVISION $OPT $TEST_PLAN --verbose
      done
    done
@@ -119,7 +126,7 @@ create_meta-intel(){
    create_test_run "${1}" "core-image-sato-sdk_ANYBSP"
 
    #BSP Autos LSB
-   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" "corei7-64_lsb_MMAX64" "corei7-64_lsb_Joule" "corei7-64_lsb_CherryHill")
+   ENVIRONMENTS=("core2-32_lsb_MMAX32" "corei7-64_lsb_NUC" "corei7-64_lsb_MMAX64" "corei7-64_lsb_CherryHill")
 
    EXECUTION_TYPE="AUTO"
    create_test_run "${1}" "core-image-lsb-sdk_ANYBSP"
@@ -226,7 +233,9 @@ usage(){
   echo " -p PROJECT VERSION  {2.2 2.3 2.4}
                           Version of the project."
   echo " -m PROJECT MILESTONE {M1 M2 M3 M4}
-                          Milestone of the project."
+                          Milestone of the project.
+			  if is point release set milestone with .#
+		          .1 .2 .3"
   echo " -r RELEASE COMMIT {XXXXXX}
                           SCM Revision of the project, commit of branch tested."
   echo " -c RELEAE CANDIDATE {rc1 rc2 rcX}
@@ -236,6 +245,7 @@ usage(){
   exit
 }
 
+
 if [[ ( $# == "--help") ||  $# == "-h" || $# -eq 0 ]] ; then
     usage
     exit 0
diff --git a/testopia_update.py b/testopia_update.py
index 50c3325..0a3f7f5 100755
--- a/testopia_update.py
+++ b/testopia_update.py
@@ -14,7 +14,7 @@ DEFAULT_CONFIG_FILE = "testopia_update.config"
 DEFAULT_STORE_LOCATION = "/tmp/testopia_update"
 
 ACTIONS = ('create', 'update')
-BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
+BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists', "pyro")
 CATEGORIES = ('AUTO', 'MANUAL')
 
 
@@ -54,6 +54,31 @@ def load_opts(args, opts_list, opts):
                             'and --results-log if test run was already created')
             sys.exit(1)
 
+
+def connect_to_testopia():
+    config = None
+    opts = Options()
+
+    testopia_config = ['url', 'username', 'password', 'store_location']
+
+    if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
+        args.config = DEFAULT_CONFIG_FILE
+
+    if args.config:
+        config = ConfigParser.SafeConfigParser()
+        config.read(args.config)
+
+        for to in testopia_config:
+            setattr(opts, to, config.get("Testopia", to))
+
+    load_opts(args, testopia_config, opts)
+
+    if not os.path.exists(opts.store_location):
+        os.makedirs(opts.store_location)
+
+    return opts, config
+
+
 class Options(object):
     pass
 
@@ -132,25 +157,12 @@ if __name__ == '__main__':
         'project_version', 'project_milestone', 'project_revision',
         'project_date']
 
-    config = None
-    if not args.config and os.path.exists(DEFAULT_CONFIG_FILE):
-        args.config = DEFAULT_CONFIG_FILE
-
-    if args.config:
-        config = ConfigParser.SafeConfigParser()
-        config.read(args.config)
-
-        for to in testopia_config:
-            setattr(opts, to, config.get("Testopia", to))
-    load_opts(args, testopia_config, opts)
-
-    if not os.path.exists(opts.store_location):
-        os.makedirs(opts.store_location)
-
     kwargs = {}
     if args.plan_name:
         kwargs['plan_name'] = args.plan_name
 
+    opts, config = connect_to_testopia()
+
     testopia = Testopia(opts.username, opts.password, opts.url, sslverify=False)
     products = get_products(testopia, opts, logger, config, **kwargs)
 
-- 
2.11.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-16 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-16 18:46 [qa-tools][PATCH] Full-test-cycle-wrapper: Add support for point releases jose.perez.carranza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.