Page MenuHomeSoftware Heritage

tests: Fix failing ones after new pytest-flask release and migration to CoreSWHID
ClosedPublic

Authored by anlambert on Mar 1 2021, 6:17 PM.

Details

Summary

swh-scanner tests are currently failing for two reasons:

  • pytest-flask removed the url method of its LiveServer class wrapped by the live_server fixture (see commit). So use recommended way to get an URL when using Flask, this requires adding a dummy root endpoint to the API in order to get its base URL.
  • migration to CoreSWHID was buggy due to missing typing information prior refactoring

Diff Detail

Repository
rDTSCN Code scanner
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

anlambert edited the summary of this revision. (Show Details)

Build is green

Patch application report for D5178 (id=18514)

Rebasing onto 3c3bdf5aa6...

Current branch diff-target is up to date.
Changes applied before test
commit 433f556301888bf7aed948c6d036e9d04b56b436
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Mar 1 18:12:18 2021 +0100

    scanner: Fix return type of swhid_of and add typing

commit 86d4c02f7aa3d0eeb1407547dcd9dc244813232d
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Mar 1 17:53:00 2021 +0100

    tests: Fix failing ones after new pytest-flask release
    
    pytest-flask removed the url method of its LiveServer class wrapped by
    the live_server fixture.
    
    So use recommended way to get an URL when using Flask, this requires
    adding a dummy root endpoint to the API in order to get its base URL.

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

This revision is now accepted and ready to land.Mar 1 2021, 7:26 PM