Page MenuHomeSoftware Heritage

Fix a bug in numfile_sortkey and add tests for it
ClosedPublic

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

Details

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 D7153 (id=25931)

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

Updating 5046a95..3139d33
Fast-forward
 MANIFEST.in                   |   1 -
 swh/core/cli/db.py            | 208 +++++++++---------------------------------
 swh/core/db/db_utils.py       | 174 ++++++++++++++++++++++++++++++++---
 swh/core/db/tests/test_cli.py |   2 +-
 swh/core/sql/log-schema.sql   |  33 -------
 swh/core/tests/test_utils.py  | 193 +++++++++++++++++++--------------------
 swh/core/utils.py             |  16 +++-
 7 files changed, 315 insertions(+), 312 deletions(-)
 delete mode 100644 swh/core/sql/log-schema.sql
Changes applied before test
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/298/ for more details.

vlorentz added a subscriber: vlorentz.

You could also return float("infinity") just to be sure :)

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

You could also return float("infinity") just to be sure :)

I actually though about it, but then it would make the typing more complex for no real reason :-)

You could also return float("infinity") just to be sure :)

I actually though about it, but then it would make the typing more complex for no real reason :-)

also a reason for this is we need this function to sort db upgrade files, which are not in the [0, 99] range for a while, so better safe than sorry I guess.