Page MenuHomeSoftware Heritage

tests: Use TimestampWithTimezone.from_datetime() instead of the constructor
ClosedPublic

Authored by vlorentz on Tue, Jan 11, 12:31 PM.

Details

Summary

A future release of swh-model will change its constructor's signature (replace 'offset'
and 'negative_utc_offset' with 'offset_bytes).

This leaves one occurence of a direct use of the constructor, as from_datetime() does
not allow negative UTC.

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D6910 (id=25048)

Could not rebase; Attempt merge onto 4e2e0ab8be...

Updating 4e2e0ab..199eb6d
Fast-forward
 swh/loader/package/archive/tests/test_archive.py   |  8 +--
 swh/loader/package/cran/tests/test_cran.py         |  7 +--
 swh/loader/package/debian/tests/test_debian.py     | 16 ++++--
 swh/loader/package/deposit/loader.py               | 14 ++++-
 .../1_private_999_meta                             |  1 +
 .../1_private_999_raw                              |  1 +
 .../hello_2.10.json                                |  3 +-
 .../hello_2.11.json                                |  3 +-
 .../hello_2.12.json                                |  3 +-
 .../hello_2.13.json                                | 66 +++++++++++++++++++++
 swh/loader/package/deposit/tests/test_deposit.py   | 67 ++++++++++++++++++++--
 swh/loader/package/maven/tests/test_maven.py       |  8 +--
 swh/loader/package/npm/tests/test_npm.py           |  8 +--
 swh/loader/tests/test_init.py                      | 20 ++++---
 14 files changed, 181 insertions(+), 44 deletions(-)
 create mode 120000 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/1_private_999_meta
 create mode 120000 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/1_private_999_raw
 create mode 100644 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json
Changes applied before test
commit 199eb6df3f2d23bfc14b9877430d749c2bc37ebf
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jan 11 12:31:01 2022 +0100

    tests: Use TimestampWithTimezone.from_datetime() instead of the constructor
    
    A future release of swh-model will change its constructor's signature (replace 'offset'
    and 'negative_utc_offset' with 'offset_bytes).
    
    This leaves one occurence of a direct use of the constructor, as from_datetime() does
    not allow negative UTC.

commit 2f9149bc9243d5abf7d96b0680ea1b54fab3ac83
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jan 11 11:34:34 2022 +0100

    Add releases notes (from user-provided Atom document) to release messages.

Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/672/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tests-on-diff/672/console

Harbormaster returned this revision to the author for changes because remote builds failed.Tue, Jan 11, 12:33 PM
Harbormaster failed remote builds in B25918: Diff 25048!

Build is green

Patch application report for D6910 (id=25050)

Could not rebase; Attempt merge onto 4e2e0ab8be...

Updating 4e2e0ab..e3d793d
Fast-forward
 swh/loader/package/archive/tests/test_archive.py   |  8 +--
 swh/loader/package/cran/tests/test_cran.py         |  7 +--
 swh/loader/package/debian/tests/test_debian.py     | 16 ++++--
 swh/loader/package/deposit/loader.py               | 14 ++++-
 .../1_private_999_meta                             |  1 +
 .../1_private_999_raw                              |  1 +
 .../hello_2.10.json                                |  3 +-
 .../hello_2.11.json                                |  3 +-
 .../hello_2.12.json                                |  3 +-
 .../hello_2.13.json                                | 66 +++++++++++++++++++++
 swh/loader/package/deposit/tests/test_deposit.py   | 67 ++++++++++++++++++++--
 swh/loader/package/maven/tests/test_maven.py       |  8 +--
 swh/loader/package/npm/tests/test_npm.py           |  8 +--
 swh/loader/tests/test_init.py                      | 20 ++++---
 14 files changed, 181 insertions(+), 44 deletions(-)
 create mode 120000 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/1_private_999_meta
 create mode 120000 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/1_private_999_raw
 create mode 100644 swh/loader/package/deposit/tests/data/https_deposit.softwareheritage.org/hello_2.13.json
Changes applied before test
commit e3d793dec541b72ae2e11c84a9e73de1af4e7fa4
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jan 11 12:31:01 2022 +0100

    tests: Use TimestampWithTimezone.from_datetime() instead of the constructor
    
    A future release of swh-model will change its constructor's signature (replace 'offset'
    and 'negative_utc_offset' with 'offset_bytes).
    
    This leaves one occurence of a direct use of the constructor, as from_datetime() does
    not allow negative UTC.

commit 2f9149bc9243d5abf7d96b0680ea1b54fab3ac83
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jan 11 11:34:34 2022 +0100

    Add releases notes (from user-provided Atom document) to release messages.

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

This revision is now accepted and ready to land.Wed, Jan 12, 11:37 AM