Page MenuHomeSoftware Heritage

cypress/origin-save: Improve tests implementation
ClosedPublic

Authored by anlambert on Sep 3 2020, 3:27 PM.

Details

Summary

Use ES6 destructuring to simulate named function parameters and improve
code readability.

Use ISO dates.

Rename "object type" to "visit type" to match swh data model.

Depends on D3873

Diff Detail

Repository
rDWAPPS Web applications
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 D3875 (id=13669)

Could not rebase; Attempt merge onto 9c41d9f90f...

Updating 9c41d9f9..b761578b
Fast-forward
 cypress/integration/origin-save.spec.js         | 137 ++++++++++++++++++------
 swh/web/assets/src/bundles/admin/origin-save.js |   4 +-
 swh/web/assets/src/bundles/save/index.js        |   4 +-
 3 files changed, 110 insertions(+), 35 deletions(-)
Changes applied before test
commit b761578b4a660ac9d7d45a9ead8bc550e4c17fb9
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Thu Sep 3 15:26:10 2020 +0200

    cypress/origin-save: Improve tests implementation
    
    Summary:
    
    Use ES6 destructuring to simulate named function parameters and improve
    code readability.
    
    Use ISO dates.
    
    Rename "object type" to "visit type" to match swh data model.
    
    Depends on D3873
    
    Test Plan:
    
    Reviewers:
    
    Subscribers:

commit f8a6cf8f24704c5832535a9d6063b92133b50d33
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Thu Sep 3 15:11:50 2020 +0200

    assets/origin-save: Fix handling of null visit dates in requests list
    
    Summary:
    When a save request task succeeded but the corresponding visit is not yet available
    in PostgreSQL database (replication lag), a null visit date can be returned so
    handle that special case.
    
    Closes T2557
    
    Reviewers: #reviewers
    
    Maniphest Tasks: T2557
    
    Differential Revision: https://forge.softwareheritage.org/D3873

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

This revision is now accepted and ready to land.Sep 3 2020, 8:38 PM