Skip to contentSkip to conversation

testopia_update/product: Fix regex to match test case id

PATCH New [email protected] 1 participant 3 messages Feb 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 testopia_update/product: Fix regex to match test case id

From: Jose Perez Carranza <[email protected]>

Add space to the regex to match all the digits of the test case id

---
 testopia_update/product/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testopia_update/product/__init__.py +1 -1
index 689d004..d7cb984 100644
@@ -147,7 +147,7 @@ class Product(object):
         return new_test_run
 
     def parse_results_log(self, log_file):
-        regex = "^.*RESULTS.*(?P<case_id>\d+): (?P<status>PASSED|FAILED)$"
+        regex = "^.*RESULTS.* (?P<case_id>\d+): (?P<status>PASSED|FAILED)$"
         if hasattr(self, 'results_regex'):
             regex = getattr(self, 'results_regex')
 
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/3 testopia_update: Add suppor for Testopia products

From: Jose Perez Carranza <[email protected]>

Add a list of supported products currently available on Testopia

---
 testopia_update/product/__init__.py        | 22 ++++++++++++++++++++++
 testopia_update/product/adt.py             |  4 ++++
 testopia_update/product/bitbake.py         |  4 ++++
 testopia_update/product/crops.py           |  4 ++++
 testopia_update/product/eclipse_plugin.py  |  4 ++++
 testopia_update/product/esdk.py            |  4 ++++
 testopia_update/product/general_runtime.py |  4 ++++
 testopia_update/product/kernel.py          |  4 ++++
 testopia_update/product/meta_yocto.py      |  4 ++++
 testopia_update/product/oe_core.py         |  4 ++++
 testopia_update/product/runtime.py         |  4 ++++
 11 files changed, 62 insertions(+)
 create mode 100644 testopia_update/product/adt.py
 create mode 100644 testopia_update/product/bitbake.py
 create mode 100644 testopia_update/product/crops.py
 create mode 100644 testopia_update/product/eclipse_plugin.py
 create mode 100644 testopia_update/product/esdk.py
 create mode 100644 testopia_update/product/general_runtime.py
 create mode 100644 testopia_update/product/kernel.py
 create mode 100644 testopia_update/product/meta_yocto.py
 create mode 100644 testopia_update/product/oe_core.py
 create mode 100644 testopia_update/product/runtime.py
testopia_update/product/__init__.py +22 -0
index d7cb984..e401824 100644
@@ -187,13 +187,35 @@ class Product(object):
         return missing
 
 def get_products(testopia, opts, config, logger):
+
+
+    from . import bitbake
+    from . import meta_yocto
     from . import bsp_qemu
+    from . import oe_core
+    from . import runtime
     from . import toaster
+    from . import adt
+    from . import crops
+    from . import eclipse_plugin
+    from . import esdk
+    from . import kernel
+    from . import general_runtime
 
     products = []
 
+    products.append(bitbake.BitbakeProduct(testopia, opts, logger, config))
     products.append(bsp_qemu.BSPQEMUProduct(testopia, opts, logger, config))
+    products.append(meta_yocto.MetaYoctoProduct(testopia, opts, logger, config))
+    products.append(oe_core.OECoreProduct(testopia, opts, logger, config))
+    products.append(runtime.RuntimeProduct(testopia, opts, logger, config))
     products.append(toaster.ToasterProduct(testopia, opts, logger, config))
+    products.append(adt.ADTProduct(testopia, opts, logger, config))
+    products.append(crops.CROPSProduct(testopia, opts, logger, config))
+    products.append(eclipse_plugin.EclipePluginProduct(testopia, opts, logger, config))
+    products.append(esdk.eSDKProduct(testopia, opts, logger, config))
+    products.append(kernel.KernelProduct(testopia, opts, logger, config))
+    products.append(general_runtime.GeneralRuntimeProduct(testopia, opts, logger, config))
 
     return products
 
testopia_update/product/adt.py new file +4 -0
new file mode 100644
index 0000000..73c82d3
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class ADTProduct(Product):
+    name = 'ADT'
testopia_update/product/bitbake.py new file +4 -0
new file mode 100644
index 0000000..6eef591
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class BitbakeProduct(Product):
+    name = 'BitBake'
testopia_update/product/crops.py new file +4 -0
new file mode 100644
index 0000000..90dcc69
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class CROPSProduct(Product):
+    name = 'CROPS'
testopia_update/product/eclipse_plugin.py new file +4 -0
new file mode 100644
index 0000000..a88ab8a
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class EclipePluginProduct(Product):
+    name = 'Eclipse Plugin'
testopia_update/product/esdk.py new file +4 -0
new file mode 100644
index 0000000..8b004dd
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class eSDKProduct(Product):
+    name = 'eSDK'
testopia_update/product/general_runtime.py new file +4 -0
new file mode 100644
index 0000000..dac643e
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class GeneralRuntimeProduct(Product):
+    name = 'General Runtime'
testopia_update/product/kernel.py new file +4 -0
new file mode 100644
index 0000000..b2061c5
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class KernelProduct(Product):
+    name = 'Kernel'
testopia_update/product/meta_yocto.py new file +4 -0
new file mode 100644
index 0000000..5b9dc53
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class MetaYoctoProduct(Product):
+    name = 'Meta-yocto'
testopia_update/product/oe_core.py new file +4 -0
new file mode 100644
index 0000000..d2b3042
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class OECoreProduct(Product):
+    name = 'OE-Core'
testopia_update/product/runtime.py new file +4 -0
new file mode 100644
index 0000000..ec4ff0c
@@ -0,0 +1,4 @@
+from testopia_update.product import Product
+
+class RuntimeProduct(Product):
+    name = 'Runtime'
Signature · 1 line
2.1.4
#2 lore raw

PATCH 3/3 testopia_update: Fix options verification for config and params

In reply to [email protected]

From: Jose Perez Carranza <[email protected]>

A function was created to handle the load of options separately for configuration and parameters

---
 testopia_update.py | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
testopia_update.py +15 -10
index 1c2db63..9b35188 100755
@@ -17,6 +17,17 @@ ACTIONS = ('create', 'update')
 BRANCHES = ('master', 'jethro', 'dizzy', 'daisy', 'noexists')
 CATEGORIES = ('AUTO', 'MANUAL')
 
+def load_opts(args, opts_list, opts):
+    for to in opts_list:
+        if to in vars(args):
+            arg = getattr(args, to)
+            if arg:
+                setattr(opts, to, arg)
+        if not hasattr(opts, to):
+            logger.error("%s: Requires testopia %s in arguments or config." % \
+                (sys.argv[0], to))
+            sys.exit(1)
+
 class Options(object):
     pass
 
@@ -85,7 +96,7 @@ if __name__ == '__main__':
     logger = logging.getLogger()
 
     testopia_config = ['url', 'username', 'password', 'store_location']
-    testopia_opts = testopia_config + ['action', 'product_name', 'category_name',
+    testopia_opts = ['action', 'product_name', 'category_name',
         'project_version', 'project_milestone', 'project_revision',
         'project_date']
 
@@ -99,15 +110,7 @@ if __name__ == '__main__':
 
         for to in testopia_config:
             setattr(opts, to, config.get("Testopia", to))
-    for to in testopia_opts:
-        if to in vars(args):
-            arg = getattr(args, to)
-            if arg:
-                setattr(opts, to, arg)
-        if not hasattr(opts, to):
-            logger.error("%s: Requires testopia %s in arguments or config." % \
-                (sys.argv[0], to))
-            sys.exit(1)
+    load_opts(args, testopia_config, opts)
 
     if not os.path.exists(opts.store_location):
         os.makedirs(opts.store_location)
@@ -121,6 +124,8 @@ if __name__ == '__main__':
             print("%s\n" % p.name)
         sys.exit(0)
 
+    load_opts(args, testopia_opts, opts)
+
     params = ['action', 'product_name', 'branch_name', 'env_name']
     for p in params:
         if not getattr(args, p):
Signature · 1 line
2.1.4