Page MenuHomeSoftware Heritage

Clarify names around the swh.core.db.pytest_plugin tests
ClosedPublic

Authored by ardumont on Nov 20 2020, 2:17 PM.

Details

Summary

The test file name test_db_utils was unclear, test_pytest_plugin is
clearer since it relates to the actual module being tested.

This also moves the tests into its own dedicated arborescence because that's a
different module now.

Test Plan

tox

Diff Detail

Event Timeline

Build is green

Patch application report for D4544 (id=16115)

Could not rebase; Attempt merge onto 4badb90ad5...

Updating 4badb90..a7b9d0d
Fast-forward
 requirements-db-pytestplugin.txt                                    | 2 ++
 requirements-db.txt                                                 | 1 -
 setup.py                                                            | 6 ++++--
 swh/core/db/tests/pytest_plugin/__init__.py                         | 0
 swh/core/db/tests/{ => pytest_plugin}/data/0-schema.sql             | 0
 swh/core/db/tests/{ => pytest_plugin}/data/1-data.sql               | 0
 .../tests/{test_db_utils.py => pytest_plugin/test_pytest_plugin.py} | 0
 7 files changed, 6 insertions(+), 3 deletions(-)
 create mode 100644 requirements-db-pytestplugin.txt
 create mode 100644 swh/core/db/tests/pytest_plugin/__init__.py
 rename swh/core/db/tests/{ => pytest_plugin}/data/0-schema.sql (100%)
 rename swh/core/db/tests/{ => pytest_plugin}/data/1-data.sql (100%)
 rename swh/core/db/tests/{test_db_utils.py => pytest_plugin/test_pytest_plugin.py} (100%)
Changes applied before test
commit a7b9d0d8296ecfbc01aca11c46f40652bce93af4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Nov 20 13:57:21 2020 +0100

    Clarify names around the swh.core.db.pytest_plugin tests

commit 7722df9f290aefeb4f5d822578719052922739bf
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Nov 20 13:52:22 2020 +0100

    setup: Separate pytest-postgresql dependency and declare it when needed
    
    This drops the pytest-postgresql from requirements-db.txt. This is not a
    required dependency for the swh.core.db module itself.
    
    It's a requirement for the swh.core.db.pytest_plugin. This module should become
    its own module as a test requirements for other swh modules (including
    swh.core.db but not limited to it).
    
    So this commit adds a dedicated requirements-db-pytestplugin.txt file with such
    dependency. This opens the db-pytestplugin key within the setup.py and then
    references that test dependency for the swh.core.db modules (as it's needed for
    tests of the module).
    
    Related to T2746

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/146/ for more details.

Build is green

Patch application report for D4544 (id=16118)

Rebasing onto 7722df9f29...

Current branch diff-target is up to date.
Changes applied before test
commit a7b9d0d8296ecfbc01aca11c46f40652bce93af4
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Nov 20 13:57:21 2020 +0100

    Clarify names around the swh.core.db.pytest_plugin tests

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/148/ for more details.

douardda added a subscriber: douardda.

I would put (at least part of) the diff's message in the commit message, otherwise lgtm

This revision is now accepted and ready to land.Nov 20 2020, 3:15 PM

Rework commit message to add details

right, the diff description was done after the commit and i forgot to update the commit message

Build is green

Patch application report for D4544 (id=16121)

Rebasing onto 7722df9f29...

Current branch diff-target is up to date.
Changes applied before test
commit a64357b272a871ceefe6ec2c621613b2b2411ce2
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date:   Fri Nov 20 13:57:21 2020 +0100

    Clarify names around the swh.core.db.pytest_plugin tests
    
    This renames the test file to test_pytest_plugin which is clearer since it
    relates to the actual module being tested.
    
    This also moves the tests into its own dedicated arborescence because that's a
    different module now.

See https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/150/ for more details.