Cannot run a specific test after pytest migration

Bug #1875123 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Akihiro Motoki

Bug Description

After pytest migration, we cannot run a specific test explicitly.

Previously we can use

  tox -e py37 -- openstack_auth.test.unit.test_policy

to run only tests under openstack_auth/test/unit/test_policy.py.

After the pytest migration, tools/unit_test.sh only honors the module name like openstack_dashboard, horizon, openstack_auth.
This is a regression during the pytest migration.

Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.opendev.org/723134

Changed in horizon:
assignee: nobody → Akihiro Motoki (amotoki)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.opendev.org/723134
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ccaaf8cbb928693a6db317cf19ac39ec7a47a832
Submitter: Zuul
Branch: master

commit ccaaf8cbb928693a6db317cf19ac39ec7a47a832
Author: Akihiro Motoki <email address hidden>
Date: Sun Apr 26 14:07:16 2020 +0900

    Fix regressions in unit_tests.sh during pytest mirgation

    The pytest migration patch introduced a couple of regression in
    tools/unit_tests.sh:

    * We no longer cannot run a specific test explicitly
      (per python file, per test class, per specific test).
      Per module like openstack_dashboard, openstack_auth and horizon
      is the only possible way after the pytest migration.
    * openstack_dashboard tests outside of openstack_dashboard/test/
      are not looked up when a subset is specified.

    This commit restores the orginal behavior.

    pytest uses a different way to specify tests.
    We cannot use the style of python modules like
    "openstack_auth.tests.unit.test_policy.PolicyLoaderTestCase.test_policy_file_load"
    and we need to specify tests like file paths [1].

    [1] https://docs.pytest.org/en/latest/usage.html#specifying-tests-selecting-tests

    Closes-Bug: #1875123
    Change-Id: Ic4b6c69d8a2ed774cce16521c4c4336f55ff737e

Changed in horizon:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.