neutron-specs/specs/kilo/reorganize-unit-test-tree.rst
armando-migliaccio 415f1eaf5b Revisit the structure of the specs repo
Instead of having a per-release backlog directory, create
a top level one that holds the last release backlog. In
a healthy project this directory is really meant to be
empty or only temporary filled.

For specs that are two releases older, the content will
be moved to an 'archive' directory, purely for the record.
Hopefully this one too will be empty.

API and Juno incubator were moved to a miscellanea
directory to finish off the cleanup.

Finally, some blueprints completed and therefore were
moved to the Liberty directory.

Change-Id: I972a9a56c038864d9c91ead6944c6b9355916668
2015-10-28 21:55:08 +00:00

2.7 KiB

Example Spec - The title of your blueprint

https://blueprints.launchpad.net/neutron/+spec/reorganize-unit-test-tree

Reorganize the structure of the unit test tree to be consistent with the structure of the code tree.

Problem Description

There is no consistent organization of unit test modules (neutron/test/unit/*). There is no easy way to find the unit tests for a given module, making it challenging to determine whether code is well-tested. There are also no clear guideline as to where new tests should go, ensuring that the problem continues.

Proposed Change

The module structure of the neutron/tests/unit subtree should be changed to mirror the structure of the code tree.

  • The path structure should be the same. This implies that modules under the path:

    neutron/[path]

    should have test modules in the following location

    neutron/tests/unit/[path]

    For example, test modules for 'neutron/scheduler' should have tests at 'neutron/tests/unit/scheduler'.

  • The name of the test modules should correspond to the name of the module under test, prefixed with 'test_'. For example, the module 'neutron/scheduler/dhcp_agent_scheduler.py' implies the test module 'neutron/tests/unit/scheduler/test_dhcp_agent_scheduler.py'.

This requirement should be documented such that new changes follow this scheme.

Data Model Impact

None

REST API Impact

None

Security Impact

None

Notifications Impact

None

Other End User Impact

None

Performance Impact

None

IPv6 Impact

None

Other Deployer Impact

None

Developer Impact

Patch authors and reviewers will need to ensure that new changes maintain the consistent structuring of the unit test tree.

Community Impact

None

Alternatives

None

Implementation

Assignee(s)

Primary assignee:

marun

Work Items

  • Reorganize the test tree

Dependencies

None

Testing

None

Tempest Tests

None

Functional Tests

None

API Tests

None

Documentation Impact

None

User Documentation

None

Developer Documentation

The required structure of the unit test tree should be documented in the in-tree developer documentation.

References

[1] https://pytest.org/latest/goodpractises.html