From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: jose.perez.carranza@linux.intel.com, yocto@yoctoproject.org
Subject: Re: [qa-tools][PATCH v2] testopia_update: Add option to define test plan
Date: Tue, 7 Mar 2017 10:44:55 -0600 [thread overview]
Message-ID: <58BEE387.7060104@linux.intel.com> (raw)
In-Reply-To: <20170307135854.3662-1-jose.perez.carranza@linux.intel.com>
[-- Attachment #1: Type: text/plain, Size: 6687 bytes --]
Ack
On 03/07/2017 07:58 AM, jose.perez.carranza@linux.intel.com wrote:
> From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
>
> There are cases where the test plan and the product name are not equal hence
> an option is added to handle those cases and define the test plan to work on.
>
> Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
> ---
> testopia_update.py | 13 +++++++++---
> testopia_update/product/__init__.py | 40 ++++++++++++++++++++-----------------
> 2 files changed, 32 insertions(+), 21 deletions(-)
>
> diff --git a/testopia_update.py b/testopia_update.py
> index 9b35188..044074a 100755
> --- a/testopia_update.py
> +++ b/testopia_update.py
> @@ -70,6 +70,9 @@ def get_args():
> dest="project_revision", help='SCM Revision of the project.')
> parser.add_argument('--project-date', required=False,
> dest="project_date", help='SCM version/revision date of the project.')
> + parser.add_argument('--test-plan', required=False,
> + dest="plan_name", help='Name of the test plan of the product, used when \
> + test plan name is different from product name.')
>
> parser.add_argument('--results-log', required=False,
> dest="results_log", help='Results log.')
> @@ -115,8 +118,12 @@ if __name__ == '__main__':
> if not os.path.exists(opts.store_location):
> os.makedirs(opts.store_location)
>
> + kwargs = {}
> + if args.plan_name:
> + kwargs['plan_name'] = args.plan_name
> +
> testopia = Testopia(opts.username, opts.password, opts.url, sslverify=False)
> - products = get_products(testopia, opts, logger, config)
> + products = get_products(testopia, opts, logger, config, **kwargs)
>
> if args.list_products:
> print("List of available products: \n")
> @@ -141,8 +148,8 @@ if __name__ == '__main__':
>
> test_plan = product.get_test_plan(args.branch_name)
> if not test_plan:
> - logger.error("%s: Test plan for product %s and branch %s not exists."\
> - % (sys.argv[0], args.product_name, args.branch_name))
> + logger.error("%s: Test plan %s for product %s and branch %s not exists."\
> + % (sys.argv[0], product.plan ,args.product_name, args.branch_name))
>
> sys.exit(1)
>
> diff --git a/testopia_update/product/__init__.py b/testopia_update/product/__init__.py
> index e401824..18b112e 100644
> --- a/testopia_update/product/__init__.py
> +++ b/testopia_update/product/__init__.py
> @@ -1,13 +1,17 @@
> import re
>
> -
> class Product(object):
> - def __init__(self, testopia, opts, logger, config):
> + def __init__(self, testopia, opts, logger, config, **kwargs):
> self.testopia = testopia
> self.opts = opts
> self.logger = logger
> self.config = config
>
> + if 'plan_name' in kwargs:
> + self.plan = kwargs['plan_name']
> + else:
> + self.plan = self.name
> +
> def support(self, name):
> if self.name == name:
> return True
> @@ -16,11 +20,11 @@ class Product(object):
> def get_test_plan(self, branch_name):
> tp = None
>
> - tp_name = '%s: %s branch' % (self.name, branch_name)
> + tp_name = '%s: %s branch' % (self.plan, branch_name)
>
> tp = self.testopia.testplan_list(name=tp_name)
> if not tp:
> - tp_alt_name = '%s: %s branch' % (self.name, branch_name.lower())
> + tp_alt_name = '%s: %s branch' % (self.plan, branch_name.lower())
> tp = self.testopia.testplan_list(name=tp_alt_name)
>
> if tp:
> @@ -68,7 +72,7 @@ class Product(object):
> category_name, optional):
> summary_alts = []
> summary_alts.append('%s_%s_%s_%s' % (ttype, project_version,
> - category_name, self.name))
> + category_name, self.plan))
> summary_alts.append('%s_%s_%s' % (ttype, project_version,
> category_name))
> summary_alts.append('%s_%s' % (ttype, category_name))
> @@ -186,7 +190,7 @@ class Product(object):
>
> return missing
>
> -def get_products(testopia, opts, config, logger):
> +def get_products(testopia, opts, config, logger, **kwargs):
>
>
> from . import bitbake
> @@ -204,18 +208,18 @@ def get_products(testopia, opts, config, logger):
>
> 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))
> + products.append(bitbake.BitbakeProduct(testopia, opts, logger, config, **kwargs))
> + products.append(bsp_qemu.BSPQEMUProduct(testopia, opts, logger, config, **kwargs))
> + products.append(meta_yocto.MetaYoctoProduct(testopia, opts, logger, config, **kwargs))
> + products.append(oe_core.OECoreProduct(testopia, opts, logger, config, **kwargs))
> + products.append(runtime.RuntimeProduct(testopia, opts, logger, config, **kwargs))
> + products.append(toaster.ToasterProduct(testopia, opts, logger, config, **kwargs))
> + products.append(adt.ADTProduct(testopia, opts, logger, config, **kwargs))
> + products.append(crops.CROPSProduct(testopia, opts, logger, config, **kwargs))
> + products.append(eclipse_plugin.EclipePluginProduct(testopia, opts, logger, config, **kwargs))
> + products.append(esdk.eSDKProduct(testopia, opts, logger, config, **kwargs))
> + products.append(kernel.KernelProduct(testopia, opts, logger, config, **kwargs))
> + products.append(general_runtime.GeneralRuntimeProduct(testopia, opts, logger, config, **kwargs))
>
> return products
>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2017-03-07 16:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-07 13:58 [qa-tools][PATCH v2] testopia_update: Add option to define test plan jose.perez.carranza
2017-03-07 16:44 ` Aníbal Limón [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58BEE387.7060104@linux.intel.com \
--to=anibal.limon@linux.intel.com \
--cc=jose.perez.carranza@linux.intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.