Merge lp://staging/~liuyq0307/lava-android-test/exclude-shells-commands-hostshells-test-from-list into lp://staging/lava-android-test

Proposed by Yongqin Liu
Status: Work in progress
Proposed branch: lp://staging/~liuyq0307/lava-android-test/exclude-shells-commands-hostshells-test-from-list
Merge into: lp://staging/lava-android-test
Diff against target: 40 lines (+16/-3)
1 file modified
lava_android_test/provider.py (+16/-3)
To merge this branch: bzr merge lp://staging/~liuyq0307/lava-android-test/exclude-shells-commands-hostshells-test-from-list
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+144222@code.staging.launchpad.net

Description of the change

 exclue the shells/commands/hostshells test from the list-tests command

 these three tests(shells/commands/hostshells)are not the real test,
 and so that they can not be installed and run, so here is the fix to
 exclude them from the list-tests sub command

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

This is change concerns me a bit:

> def list_test(self):
> - return self.list_mod(test_definitions.__path__)
> + providers = self.get_test_provider_list()
> + avoid_dirs = []
> + for provider in providers:
> + test_prefix = provider.test_prefix
> + if test_prefix:
> + avoid_dirs.append('%ss' % test_prefix)
> + test_list = self.list_mod(test_definitions.__path__)
> + if not avoid_dirs:
> + return test_list
> + else:
> + ret_list = []
> + for test_id in test_list:
> + if not test_id in avoid_dirs:
> + ret_list.append(test_id)
> + return ret_list
>

The way avoid_dirs gets built is based on your current naming
convention. Instead of guessing avoid dirs that way, why not do
something like:

  def _get_dirs(pathname):
    return [x for x in os.listdir(pathname) if os.path.isdir(x)]

then you could just do:
   avoid_dirs = _get_dirs(test_definitions.__path__)

I'm not a big fan of the logic for removing those items from the list.
The "if not avoid_dirs:" check isn't needed.

233. By Yongqin Liu

merge with trunk

234. By Yongqin Liu

keep the original change of provider.py for review

Unmerged revisions

234. By Yongqin Liu

keep the original change of provider.py for review

233. By Yongqin Liu

merge with trunk

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