Bug#809442: autopkgtest: Add a way to run the same test script in multiple environments

Martin Pitt mpitt at debian.org
Thu Dec 31 07:36:26 UTC 2015


Hello Raphaël,

Raphaël Hertzog [2015-12-30 19:33 +0100]:
> I just added some DEP-8 tests to python-django and it would have been nice
> if I could have reused the same script in multiple environments (python2
> only, python3 only). Right now I created symlinks to the same script
> and the sole purpose of the symlink is to provide a different identifier
> for autopkgtest.

This is actually what "Test-Command:" is intended for. For your case
you'd only have debian/tests/django.py (without a hashbang) and run it
like

  Test-Command: python debian/tests/django.py
  Depends: python-django

  Test-Command: python3 debian/tests/django.py
  Depends: python3-django

> I would suggest to be able to append something "@variant" like to
> test names. It would keep that suffix to identify the test but it would
> strip it to find the test script to actually run. The suffix would
> be passed in ADT_VARIANT so that the script can make use of it if needed
> (usually to set some different default values).

You can't use environment variables in hashbangs, so this wouldn't
help you that much -- you would still need a wrapper shell script like

  #!/bin/sh
  $ADT_VARIANT debian/tests/mytest

which doesn't make the thing any easier or more elegant.

So from my POV I consider Test-Command: generic and flexible enough
for this. What do you think?

Thanks,

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)



More information about the autopkgtest-devel mailing list