The existing work on test parameterization was all done by James Ren before
his departure; I'm not sure what the current plans are regarding completing
his work, so I'll add Mikhail, Jean-Marc and Greg to this thread in case
they can comment on it.

-- John

On Thu, Dec 23, 2010 at 10:28 AM, Eric Li(李咏竹) <[email protected]> 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.
>
> 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

Reply via email to