Page MenuHomeSoftware Heritage

Refactor the mock_package_sql fixture to allow multiple sql script set
ClosedPublic

Authored by douardda on Feb 11 2022, 12:22 PM.

Details

Summary

will be used to implement several test scenarios in following commits.
Also rename existing sql scripts with a "legit" numbering scheme.

Depends on D7153

Split from D7062

Event Timeline

Build is green

Patch application report for D7154 (id=25932)

Could not rebase; Attempt merge onto 5046a95f05...

Updating 5046a95..b1e449f
Fast-forward
 MANIFEST.in                                        |   2 +-
 swh/core/cli/db.py                                 | 208 +++++----------------
 swh/core/db/db_utils.py                            | 174 +++++++++++++++--
 .../tests/data/cli/{1-schema.sql => 30-schema.sql} |   0
 .../db/tests/data/cli/{3-func.sql => 40-funcs.sql} |   0
 .../db/tests/data/cli/{4-data.sql => 50-data.sql}  |   0
 swh/core/db/tests/test_cli.py                      |  35 +++-
 swh/core/sql/log-schema.sql                        |  33 ----
 swh/core/tests/test_utils.py                       | 193 ++++++++++---------
 swh/core/utils.py                                  |  16 +-
 10 files changed, 341 insertions(+), 320 deletions(-)
 rename swh/core/db/tests/data/cli/{1-schema.sql => 30-schema.sql} (100%)
 rename swh/core/db/tests/data/cli/{3-func.sql => 40-funcs.sql} (100%)
 rename swh/core/db/tests/data/cli/{4-data.sql => 50-data.sql} (100%)
 delete mode 100644 swh/core/sql/log-schema.sql
Changes applied before test
commit b1e449fd91ebcc403966a79fd62d449921fcf550
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jan 28 16:00:43 2022 +0100

    Refactor the mock_package_sql fixture to allow multiple sql script set
    
    will be used to implement several test scenarios in following commits.
    Also rename existing sql scripts with a "legit" numbering scheme.

commit 3139d3344e232db83edacc95884604e47f0461cb
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Feb 11 12:10:43 2022 +0100

    Fix a bug in numfile_sortkey and add tests for it

commit 68dc6811967ff0f6fb1296f9687d22d7f0fb684b
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Feb 11 11:59:56 2022 +0100

    Convert test_utils to pytest

commit 3e43730df6150168ca99cb083bd2e60feb4a2771
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jan 28 14:54:39 2022 +0100

    Make `swh db init` retrieve the db cnx uri from the config file

commit 459da96c1e6b6044deb874e0e668606c3da3e43c
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jan 28 14:49:41 2022 +0100

    Move utility functions from cli.db to db.db_utils

commit 932eed4863baedf011b4a59d0227331d37db1dfd
Author: David Douard <david.douard@sdfa3.org>
Date:   Fri Jan 28 10:07:35 2022 +0100

    Remove the old and unused log-schema.sql file

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

This revision is now accepted and ready to land.Feb 14 2022, 12:32 PM