Page MenuHomeSoftware Heritage

pytest_plugin: use the stock pytest_postgresql postgresql factory
ClosedPublic

Authored by douardda on May 31 2022, 1:38 PM.

Details

Summary

instead of swh-core's postgresql_fact one, since we actually do not
use its custom features any more in swh-storage.

Diff Detail

Event Timeline

Build is green

Patch application report for D7918 (id=28533)

Rebasing onto cb12394c34...

Current branch diff-target is up to date.
Changes applied before test
commit 4b41bdf96f18ffa0fdf90ec239c43ee6f2e050a3
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue May 31 12:37:04 2022 +0200

    pytest_plugin: use the stock pytest_postgresql postgresql factory
    
    instead of swh-core's postgresql_fact one, since we actually do not
    use its custom features any more in swh-storage.

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

This revision is now accepted and ready to land.May 31 2022, 2:03 PM

instead of swh-core's postgresql_fact one, since we actually do not
use its custom features any more in swh-storage.

Well, initially the feature used was the reset between tables to make
it faster than it was (and it worked 'cause it was hellishly slow to drop
and create tables again).

So, now storage uses the template to make the tests go as fast, is that it?

instead of swh-core's postgresql_fact one, since we actually do not
use its custom features any more in swh-storage.

Well, initially the feature used was the reset between tables to make
it faster than it was (and it worked 'cause it was hellishly slow to drop
and create tables again).

So, now storage uses the template to make the tests go as fast, is that it?

yes, when using the load argument of the postgresql_proc factory, it is used to initialize the template database used to create the db for each test.
For this to work, the dbname used when calling the postgresql_proc factory function must be the same as the one used to call the postgresql factory (so the removal of dbname="storage" in this diff; just use default db names unless specifically needed).

instead of swh-core's postgresql_fact one, since we actually do not
use its custom features any more in swh-storage.

Well, initially the feature used was the reset between tables to make
it faster than it was (and it worked 'cause it was hellishly slow to drop
and create tables again).

So, now storage uses the template to make the tests go as fast, is that it?

yes, when using the load argument of the postgresql_proc factory, it is used to initialize the template database used to create the db for each test.
For this to work, the dbname used when calling the postgresql_proc factory function must be the same as the one used to call the postgresql factory (so the removal of dbname="storage" in this diff; just use default db names unless specifically needed).

nice.

Build is green

Patch application report for D7918 (id=28536)

Rebasing onto a936cfda1f...

Current branch diff-target is up to date.
Changes applied before test
commit bb68fcecfbae9779d1ad90965e2a2abc5a2c6aff
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue May 31 12:37:04 2022 +0200

    pytest_plugin: use the stock pytest_postgresql postgresql factory
    
    instead of swh-core's postgresql_fact one, since we actually do not
    use its custom features any more in swh-storage.

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

Build is green

Patch application report for D7918 (id=28567)

Rebasing onto a936cfda1f...

Current branch diff-target is up to date.
Changes applied before test
commit e64d64e4daada920e55476a3ece92ea453699290
Author: David Douard <david.douard@sdfa3.org>
Date:   Tue May 31 12:37:04 2022 +0200

    pytest_plugin: use the stock pytest_postgresql postgresql factory
    
    instead of swh-core's postgresql_fact one, since we actually do not
    use its custom features any more in swh-storage.

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