On Tue, Jan 4, 2011 at 11:59 AM, Lucas Meneghel Rodrigues 
<[email protected]>wrote:

> On Thu, 2010-12-23 at 10:28 -0800, Eric Li(李咏竹) wrote:
> > Autotest,
> >
> >
> > There are bunch of tables supposed to support parameterized job for
> > autotest, but seems the development of that feature was halted, not
> > too many code has been added to support that function.
> >
> >
> > The ChromiumOS test project is interested to take some advantage of
> > that. And following the original design, the first step seems to
> > define and support parameterized test.
> >
> >
> > So I simply introduced an optional control file variables:
> > TEST_PARAMETERS="para1,para2,para2...:", and it will be parsed by
> > utils/test_importer and saved into afe_test_parameters table in the db
> > for future use.
>
> ^ This is fairly simple and clean, however, we need to think about other
> cases, such as:
>
> * Parameter injection through the CLI (ie, additional command line
> arguments that could be used as test parameters)
>
We have plan to inject parameter through CLI. But it will take a while
before its ready for review.


> * Parameter injection through the web interface (ie fields on the web
> app to feed those parameters)
>
> I dont have plan to do this for now.


> Our team also wants to take advantage of parametrization, it'd be
> interesting to know what was the original implementation plan of the
> feature.
>
> I tried my best to follow the original design based on what ever already
checked in and keep the the changes minimum. And seems to import test
parameters into database is the first step. Without it, you could not
instantiate parameterized job through CLI and JSON_RPC.

Eric

>
> > Please review.
> > Index: utils/test_importer.py
> > ===================================================================
> > --- utils/test_importer.py (revision 5005)
> > +++ utils/test_importer.py (working copy)
> > @@ -241,6 +241,12 @@
> >
> >          _log_or_execute(repr(new_test), new_test.save)
> >          add_label_dependencies(new_test)
> > +
> > +        # save TestParameter
> > +        for para_name in data.test_parameters:
> > +          test_parameter =
> > models.TestParameter.objects.get_or_create(
> > +              test=new_test, name=para_name)[0]
> > +          test_parameter.save()
> >
> >
> >  def _set_attributes_clean(test, data):
> > Index: client/common_lib/control_data.py
> > ===================================================================
> > --- client/common_lib/control_data.py (revision 5005)
> > +++ client/common_lib/control_data.py (working copy)
> > @@ -19,6 +19,7 @@
> >          self.experimental = False
> >          self.run_verify = True
> >          self.sync_count = 1
> > +        self.test_parameters = set()
> >
> >          diff = REQUIRED_VARS - set(vars)
> >          if len(diff) > 0:
> > @@ -135,6 +136,10 @@
> >          self._set_option('test_type', val, ['client', 'server'])
> >
> >
> > +    def set_test_parameters(self, val):
> > +        self._set_set('test_parameters', val)
> > +
> > +
> >  def _extract_const(n):
> >      assert(n.__class__ == compiler.ast.Assign)
> >      assert(n.expr.__class__ == compiler.ast.Const)
> >
> >
> >
> >
> >
> >
> >
> >
> > Merry Christmas
> >
> > --
> > Eric Li
> > 李咏竹
> > Google Kirkland
> >
> >
> >
> > _______________________________________________
> > Autotest mailing list
> > [email protected]
> > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>
>
>


-- 
Eric Li
李咏竹
Google Kirkland
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to