[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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

Hi Martin,

thanks for your quick answer.

On Thu, 31 Dec 2015, Martin Pitt wrote:
> 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

Except that I run a shell script where I execute python scripts and I just
want to ensure that they work... in my case /usr/bin/django-admin has some magical
code to figure out whether python3 is available or not and run the right
script with the right interpreter. So would something like this be

    Test-Command: debian/tests/django-admin
    Depends: python-django

    Test-Command: debian/tests/django-admin
    Depends: python3-django

I assumed that it was not ok because you would have no way to
differentiate between both tests... but I guess that I could add
a fake unused parameter to differentiate them.

You might also want to improve the description of the Test-Command
field in README.package-tests to make this use-case more explicit, I
mainly skipped it because it was advertised to run pre-existing test
scripts from upstream and such.

> You can't use environment variables in hashbangs, so this wouldn't

That was not my use case, I run plain shell scripts. In a second test,
I just used the python interpreter to run the upstream test suite after
having copied it to $ADTTMP.

See http://anonscm.debian.org/cgit/python-modules/packages/python-django.git/tree/debian/tests/test-suite

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

Looks like it's enough for my needs, yes, but documenting this use case
would be most welcome.

Rapha?l Hertzog ? Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/

Reply to: