Use PostgreSQL backend for django database in tests (T3601)
- Added reset_sequence=True in the db fixture
- Fixed timestamp comparison issue by ignoring microsecond
Differential D6372
Replace Sqlite with Postgres in unit tests jayeshv on Sep 29 2021, 1:46 PM. Authored by
Details
Use PostgreSQL backend for django database in tests (T3601)
Diff Detail
Event TimelineComment Actions Build has FAILED Patch application report for D6372 (id=23168)Rebasing onto 36f7ed0e5d... Current branch diff-target is up to date. Changes applied before testcommit da9de3d54ace58075849fed9c2c6ea2df6dd966b Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Sep 29 13:41:04 2021 +0200 Replace Sqlite with Postgres in unit tests Use PostgreSQL backend for django database in tests (T3601) - Added reset_sequence=True in the db fixture - Fixed timestamp comparison issue by ignoring microsecond Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1127/ Comment Actions Replace Sqlite with Postgres in unit tests Use PostgreSQL backend for django database in tests (T3601)
Comment Actions Build has FAILED Patch application report for D6372 (id=23210)Rebasing onto 7843408037... Current branch diff-target is up to date. Changes applied before testcommit 15dca7996be3f589cdd0a7ce0c518360ab882273 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Thu Sep 30 13:28:56 2021 +0200 Replace Sqlite with Postgres in unit tests Use PostgreSQL backend for django database in tests (T3601) - Added reset_sequence=True in the db fixture - Fixed timestamp comparison issue by ignoring microseconds - Pinned psycopg2 to 2.8.6 (To fix UTC related assertion error) Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1129/ Comment Actions Replace Sqlite with Postgres in unit tests Use PostgreSQL backend in django database in tests
Changed conftest to use sqlite3 for frontend tests related to T3601 Comment Actions Build is green Patch application report for D6372 (id=23221)Rebasing onto 7843408037... Current branch diff-target is up to date. Changes applied before testcommit 5ec4a98ff749fe73a0455460e9894a0542c1ab23 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Fri Oct 1 11:41:16 2021 +0200 Replace Sqlite with Postgres in unit tests Use PostgreSQL backend for django database in tests (T3601) - Added reset_sequence=True in the db fixture - Fixed timestamp comparison issue by ignoring microseconds - Pinned psycopg2 to 2.8.6 (To fix UTC related assertion error) Changed conftest to use sqlite3 for frontend tests See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1130/ for more details. Comment Actions Looks good to me, I added two nitpick comments for small improvements.
Comment Actions Build is green Patch application report for D6372 (id=23231)Rebasing onto 7843408037... Current branch diff-target is up to date. Changes applied before testcommit 224356feace82f6c20dfbcd518b8ba02b1f3bd54 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Fri Oct 1 13:54:19 2021 +0200 Use PostgreSQL backend in django database in tests Added reset_sequence=True in the db fixture Pinned psycopg2 to < 2.9 (To fix UTC related assertion error) Changed conftest to use sqlite3 for frontend tests See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1131/ for more details. Comment Actions How did you manage to fix it ? I got the microseconds comparison issue that morning when testing the changes. Comment Actions Build is green Patch application report for D6372 (id=23232)Rebasing onto 7843408037... Current branch diff-target is up to date. Changes applied before testcommit a41f090641760119f33fb4beb2187727df7c2d0c Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Fri Oct 1 14:00:22 2021 +0200 Use PostgreSQL backend in django database in tests Added reset_sequence=True in the db fixture Pinned psycopg2 to < 2.9 (To fix UTC related assertion error) Changed conftest to use sqlite3 for frontend tests See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1132/ for more details. |