public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Joshua Lock <joshua.g.lock@linux.intel.com>
To: jwang <jing.j.wang@intel.com>, openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/4] meta: introduce a small baserunner framework
Date: Thu, 15 Sep 2016 14:15:31 +0100	[thread overview]
Message-ID: <1473945331.3558.32.camel@linux.intel.com> (raw)
In-Reply-To: <1473729455-32649-1-git-send-email-jing.j.wang@intel.com>

Hi Jing, 

Thanks for your submission.

On Tue, 2016-09-13 at 09:17 +0800, jwang wrote:
> From: zjh <junhuix.zhang@intel.com>

There's no commit message here, which makes this harder to review as I
have to try and work out what it's for and why we want it. 

A useful commit message would tell me why we are introducing a
baserunner framework. This may also make a useful comment in the code
itself.

Also, the patch prefix for the series should be "lib/oeqa", i.e

"[PATCH 3/4] lib/oeqa: use baserunner in oetest"

> Signed-off-by: zjh <junhuix.zhang@intel.com>
> ---
>  meta/lib/base/baserunner.py | 60
> +++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
>  create mode 100755 meta/lib/base/baserunner.py
> 
> diff --git a/meta/lib/base/baserunner.py
> b/meta/lib/base/baserunner.py
> new file mode 100755
> index 0000000..56b838e
> --- /dev/null
> +++ b/meta/lib/base/baserunner.py
> @@ -0,0 +1,60 @@
> +#!/usr/bin/env python

We're defaulting to Python3 in OE-Core nowadays, do you really want
Python2 here (which is the default Python on most Linux distros)

> +# Copyright (C) 2013 Intel Corporation
> +#
> +# Released under the MIT license (see COPYING.MIT)
> +
> +# Base unittest module used by testrunner
> +# This provides the common test runner functionalities including
> manifest input,
> +# xunit output, timeout, tag filtering.
> +
> +"""Base testrunner"""
> +
> +from __future__ import absolute_import
> +import os
> +import sys
> +import time
> +import unittest
> +import shutil
> +
> +class TestContext(object):
> +    '''test context which inject into testcase'''
> +    def __init__(self):
> +        self.target = None
> +
> +class FakeOptions(object):
> +    '''This class just use for configure's defualt arg.
> +       Usually, we use this object in a non comandline
> environment.'''
> +    timeout = 0
> +    def __getattr__(self, name):
> +        return None

What's the purpose of overloading __getattr__() here?

> +
> +class TestRunnerBase(object):
> +    '''test runner base '''

This comment isn't very useful, same for other similar comments in this
series.

> +    def __init__(self, context=None):
> +        self.tclist = []
> +        self.runner = None
> +        self.context = context if context else TestContext()

This would probably be better as: 
self.context = context or TestContext()

or better yet, pass TestContext() as the default param for context,
rather than None?

> +        self.test_result = None
> +        self.run_time = None
> +
> +
> +    def configure(self, options=FakeOptions()):
> +        '''configure before testing'''
> +        pass
> +
> +    def result(self):
> +        '''output test result '''
> +        pass
> +
> +    def loadtest(self, names=None):
> +        '''load test suite'''
> +        pass
> +
> +    def runtest(self, testsuite):
> +        '''run test suite'''
> +        pass
> +
> +    def start(self, testsuite):
> +        '''start testing'''
> +        pass
> +
> -- 
> 2.1.4
> 


      parent reply	other threads:[~2016-09-15 13:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13  1:17 [PATCH 1/4] meta: introduce a small baserunner framework jwang
2016-09-13  1:17 ` [PATCH 2/4] meta: implement key baserunner features jwang
2016-09-15 13:15   ` Joshua Lock
2016-09-13  1:17 ` [PATCH 3/4] meta: use baserunner in oetest jwang
2016-09-15 13:15   ` Joshua Lock
2016-09-13  1:17 ` [PATCH 4/4] meta: modify runexported script to inherit the features from baserunner jwang
2016-09-15 13:15 ` Joshua Lock [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=1473945331.3558.32.camel@linux.intel.com \
    --to=joshua.g.lock@linux.intel.com \
    --cc=jing.j.wang@intel.com \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox