Page MenuHomeSoftware Heritage

test_storage: Sandbox psycopg2.errors import instruction where needed
AbandonedPublic

Authored by ardumont on Sep 3 2019, 5:46 PM.

Details

Reviewers
olasd
Group Reviewers
Reviewers
Summary

And do not execute them within the debian build (just yet?).

Current build [1] fails because the current debian package
python3-psycopg2 (2.7) is too old (we need 2.8 to have the import
psycopg2.errors working).

rmadison python3-psycopg2
python3-psycopg2 | 2.5.4+dfsg-1  | oldoldstable | amd64, armel, armhf, i386
python3-psycopg2 | 2.6.2-1       | oldstable    | amd64, arm64, armel, armhf, i386, mips, mips64el, mipsel, ppc64el, s390x
python3-psycopg2 | 2.7.7-1       | stable       | amd64, arm64, armel, armhf, i386, mips, mips64el, mipsel, ppc64el, s390x
python3-psycopg2 | 2.7.7-1       | testing      | arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
python3-psycopg2 | 2.7.7-1       | unstable     | arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x
python3-psycopg2 | 2.7.7-1+b1    | testing      | amd64
python3-psycopg2 | 2.7.7-1+b1    | unstable     | amd64

According to @olasd, there's a psycopg 2.8.3-1 package in the DPMT repo (indeed
-> [2]).

I do not see anything blocking a new package though [3]

So, in the mean time, trying to work around that (i don't like it and i'm not
even sure that would work, i do feel the need to try something out ;) [4]

[1] https://jenkins.softwareheritage.org/view/Debian%20packages/job/debian/job/packages/job/DSTO/job/gbp-buildpackage/69/console

[2] https://salsa.debian.org/python-team/modules/psycopg2/-/tags/upstream%2F2.8.3

[3] https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=python3-psycopg2;dist=unstable

[4] But i don't see what'd be the proper way of unstucking this (aside making a

new psycopg2 package maybe?)
Test Plan

tox
(checking the ci's result)

Diff Detail

Repository
rDSTO Storage manager
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7618
Build 10917: tox-on-jenkinsJenkins
Build 10916: arc lint + arc unit

Event Timeline

olasd requested changes to this revision.Sep 3 2019, 5:54 PM

If we depend on psycopg2.errors, we need to update the psycopg2 package, not sweep the exceptions under the rug. This will just mean that the code breaks in production instead of during the build...

Furthermore these tests are explicitly written not to be dependent on the database (they run on the in_memory storage just as well), so marking them as database-dependent is wrong.

This revision now requires changes to proceed.Sep 3 2019, 5:54 PM

If we depend on psycopg2.errors, we need to update the psycopg2 package,

/me is sad

I'll have a look at that tomorrow (for our debian repository though)

not sweep the exceptions under the rug.

Yes, totally.

This will just mean that the code breaks in production instead of during the build...

Granted

Furthermore these tests are explicitly written not to be dependent on the database (they run on the in_memory storage just as well), so marking them as database-dependent is wrong.

Right! I was completely side-tracked by the psycopg2 module name which does not intuit database independency.
(I'll have to look at that module to most probably see that indeed there is nothing dependent on pg there, solely exceptions i guess)

As usual, thanks for your input ;)