Page MenuHomeSoftware Heritage

pytest_plugins: Make postgresql_fact accept List[str] in addition to str.
ClosedPublic

Authored by vlorentz on Feb 4 2021, 2:44 PM.

Details

Summary

in D5014, swh.storage will need it to specify explicitly migration files to run.

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5016 (id=17887)

Rebasing onto 76d2a0033f...

Current branch diff-target is up to date.
Changes applied before test
commit 793c5f5ba3a2375601b9c63de708d4692e5eebcc
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Feb 4 14:43:56 2021 +0100

    pytest_plugins: Make postgresql_fact accept List[str] in addition to str.
    
    swh.storage will need it to specify explicitly migration files to run.

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

ardumont requested changes to this revision.EditedFeb 4 2021, 2:50 PM
ardumont added a subscriber: ardumont.

Fine with the idea.

Missing tests though.

Use existing tests [1] to add some equivalent tests with a fixture initialized with the new way you opened here for example.

[1] https://forge.softwareheritage.org/source/swh-core/browse/master/swh/core/db/tests/pytest_plugin/test_pytest_plugin.py$14-27

swh/core/db/pytest_plugin.py
48

Missing test scenario.

Should be simple enough to add the scenario which test it.

This revision now requires changes to proceed.Feb 4 2021, 2:50 PM

pfff

swh/core/db/tests/pytest_plugin/test_pytest_plugin.py
24

fun fact (pun intended): if you write db_name="fun" instead of db_name="fun2", it makes pytest freeze and ignore SIGTERM.

Build has FAILED

Patch application report for D5016 (id=17964)

Rebasing onto 76d2a0033f...

Current branch diff-target is up to date.
Changes applied before test
commit b37cd9a8d787cc192873143c674d590ae5797cde
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Feb 4 14:43:56 2021 +0100

    pytest_plugins: Make postgresql_fact accept List[str] in addition to str.
    
    swh.storage will need it to specify explicitly migration files to run.

Link to build: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/193/
See console output for more information: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/193/console

lgtm

Remains to fix the build (i did not check ;)

This revision is now accepted and ready to land.Feb 8 2021, 5:41 PM

Build has FAILED

Patch application report for D5016 (id=17964)

Rebasing onto 76d2a0033f...

Current branch diff-target is up to date.
Changes applied before test
commit b37cd9a8d787cc192873143c674d590ae5797cde
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Feb 4 14:43:56 2021 +0100

    pytest_plugins: Make postgresql_fact accept List[str] in addition to str.
    
    swh.storage will need it to specify explicitly migration files to run.

Link to build: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/196/
See console output for more information: https://jenkins.softwareheritage.org/job/DCORE/job/tests-on-diff/196/console

fix test failures caused by files being unsorted

Build is green

Patch application report for D5016 (id=18136)

Rebasing onto 76d2a0033f...

Current branch diff-target is up to date.
Changes applied before test
commit 576b1047998d876a16464606b78454036afa8dfc
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Thu Feb 4 14:43:56 2021 +0100

    pytest_plugins: Make postgresql_fact accept List[str] in addition to str.
    
    swh.storage will need it to specify explicitly migration files to run.

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