Merge lp://qastaging/~zyga/snapcraft/plainbox-app into lp://qastaging/~snappy-dev/snapcraft/core

Proposed by Zygmunt Krynicki
Status: Needs review
Proposed branch: lp://qastaging/~zyga/snapcraft/plainbox-app
Merge into: lp://qastaging/~snappy-dev/snapcraft/core
Diff against target: 219 lines (+215/-0)
1 file modified
runtests.py (+215/-0)
To merge this branch: bzr merge lp://qastaging/~zyga/snapcraft/plainbox-app
Reviewer Review Type Date Requested Status
Federico Gimenez (community) Needs Information
Review via email: mp+272720@code.qastaging.launchpad.net

Commit message

Add runtests.py

To post a comment you must log in.
213. By Zygmunt Krynicki

Add runtests.py

This patch adds a new tool for running tests, runtests.py, intending to
eventually replace the runtests.sh shell script.

This tool uses Plainbox APIs that are only available on python3-plainbox
0.23 (which pulls in python3-guacamole 0.9). The script is feature
complete as far as integration tests go but doesn't (yet) handle unit
tests. I'm looking at how to support that separately.

This patch makes runtests.py take optional advantage of
python3-argcomplete. When installed and properly activated (see below),
runtests.py will complete the partial identifiers of the tests to run.
This makes it easier to run one or a few tests quickly.

To enable that in your active shell, run:

eval "$(register-python-argcomplete3 runtests.py)"

Signed-off-by: Zygmunt Krynicki <email address hidden>

Revision history for this message
Federico Gimenez (fgimenez) wrote :

Looks great, the only thing missing that I see is the ability to run different test plans, now it's fixed to "normal". In the runtests.sh script you can specify the kind of tests to be run (unit or plainbox) and, in the case of plainbox tests, the test plan to be run:

$ ./runtests.sh
$ ./runtests.sh unit
$ ./runtests.sh plainbox examples

Are you planning to add this feature to the script?

Perhaps it would be also nice to get a more verbose output through an option, what do you think?

Thanks,

review: Needs Information
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm open to ideas, this MR was exactly to provoke feedback and
conversation. The second upside is that this is so trivial to modify
that you don't have to be a plainbox expert to tweak it. As for your
questions:

I'd like to integrate unit tests but there are two options: as a
plainbox job or natively from within the tool. I'll experiment which
works better.

Test plans is that something that the current script ran, we can
default to normal and switch to --examples with an option (it's
trivial as you see). If we integrate unit tests into test plans then
it would just be a selection of a test plan that matters (and we could
have a .* test plan that runs everything).

What kind of verbose output would you like to have, to show live
output as we run (not only when we fail?)

Thanks
ZK

On Wed, Sep 30, 2015 at 10:29 AM, Federico Gimenez
<email address hidden> wrote:
> Review: Needs Information
>
> Looks great, the only thing missing that I see is the ability to run different test plans, now it's fixed to "normal". In the runtests.sh script you can specify the kind of tests to be run (unit or plainbox) and, in the case of plainbox tests, the test plan to be run:
>
> $ ./runtests.sh
> $ ./runtests.sh unit
> $ ./runtests.sh plainbox examples
>
> Are you planning to add this feature to the script?
>
> Perhaps it would be also nice to get a more verbose output through an option, what do you think?
>
> Thanks,
> --
> https://code.launchpad.net/~zyga/snapcraft/plainbox-app/+merge/272720
> You are the owner of lp:~zyga/snapcraft/plainbox-app.

Revision history for this message
Federico Gimenez (fgimenez) wrote :

> Test plans is that something that the current script ran, we can
> default to normal and switch to --examples with an option (it's
> trivial as you see).

There's another thing here, for running the examples test plan we had to make some adjustments in the runtests.sh script [1], because plainbox was not able to reach the files out of $PLAINBOX_PROVIDER_DATA. Are you aware of that, will this patch take that into account?

[1]http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/integration-tests/runtests.sh#L37

> If we integrate unit tests into test plans then
> it would just be a selection of a test plan that matters (and we could
> have a .* test plan that runs everything).
>

Yes, that would be great

> What kind of verbose output would you like to have, to show live
> output as we run (not only when we fail?)
>

I think that it would be useful for debugging to have the same output as we do now with the plainbox run call used in runtests.sh, which shows all the commands executed.

Also there are some changes required for autopkgtest to work, the new dependencies should be added in [2] (including required version numbers if needed) and the calls at [3] and [4] should be adapted to the new script.

[2] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/control
[3] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/runexamples
[4] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/runtests

Thanks!

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm not aware of any issues with $PLAINBOX_PROVIDER_DATA. I'll rebase
this (there's a 2nd patch I didn't push that's a pain to touch as I
changed the IDs of each job) and see if I can reproduce it.

I get your point for other comments. I'll iterate on this. Thanks for
the feedback. :-)

On Wed, Sep 30, 2015 at 3:55 PM, Federico Gimenez
<email address hidden> wrote:
>> Test plans is that something that the current script ran, we can
>> default to normal and switch to --examples with an option (it's
>> trivial as you see).
>
> There's another thing here, for running the examples test plan we had to make some adjustments in the runtests.sh script [1], because plainbox was not able to reach the files out of $PLAINBOX_PROVIDER_DATA. Are you aware of that, will this patch take that into account?
>
> [1]http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/integration-tests/runtests.sh#L37
>
>> If we integrate unit tests into test plans then
>> it would just be a selection of a test plan that matters (and we could
>> have a .* test plan that runs everything).
>>
>
> Yes, that would be great
>
>> What kind of verbose output would you like to have, to show live
>> output as we run (not only when we fail?)
>>
>
> I think that it would be useful for debugging to have the same output as we do now with the plainbox run call used in runtests.sh, which shows all the commands executed.
>
> Also there are some changes required for autopkgtest to work, the new dependencies should be added in [2] (including required version numbers if needed) and the calls at [3] and [4] should be adapted to the new script.
>
> [2] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/control
> [3] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/runexamples
> [4] http://bazaar.launchpad.net/~snappy-dev/snapcraft/core/view/head:/debian/tests/runtests
>
> Thanks!
>
> --
> https://code.launchpad.net/~zyga/snapcraft/plainbox-app/+merge/272720
> You are the owner of lp:~zyga/snapcraft/plainbox-app.

Unmerged revisions

213. By Zygmunt Krynicki

Add runtests.py

This patch adds a new tool for running tests, runtests.py, intending to
eventually replace the runtests.sh shell script.

This tool uses Plainbox APIs that are only available on python3-plainbox
0.23 (which pulls in python3-guacamole 0.9). The script is feature
complete as far as integration tests go but doesn't (yet) handle unit
tests. I'm looking at how to support that separately.

This patch makes runtests.py take optional advantage of
python3-argcomplete. When installed and properly activated (see below),
runtests.py will complete the partial identifiers of the tests to run.
This makes it easier to run one or a few tests quickly.

To enable that in your active shell, run:

eval "$(register-python-argcomplete3 runtests.py)"

Signed-off-by: Zygmunt Krynicki <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches