Page MenuHomeSoftware Heritage

loader.cli: Reference new cli
ClosedPublic

Authored by ardumont on Dec 4 2019, 7:45 PM.

Details

Summary

This installs a swh loader subcommand.
This allows loading of url for a given loader.

This also aligns the npm loader's constructor to be consistent with other
loaders (having only one url as constructor parameter).

Related to T2134

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Branch
add-loader-cli-2
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9536
Build 14039: tox-on-jenkinsJenkins
Build 14038: arc lint + arc unit

Event Timeline

ardumont retitled this revision from loader.cli: Reference new loader cli to loader.cli: Reference new cli.Dec 5 2019, 9:37 AM
  • loader.cli: Add tests around cli

(that still cannot pass green here though, need to land the loaders' first D2395)

  • loader.cli: Reference new loader cli
  • package.npm: Align loader instantiation
  • loader.cli: Add tests around cli
  • requirements-test: Add missing test dependency
anlambert added a subscriber: anlambert.

Looks good to me !

swh/loader/cli.py
61

Load an origin from its url with loader <name>

swh/loader/package/npm/loader.py
49

nitpick: it's better to use concrete type (here Dict) when typing return value

swh/loader/tests/test_cli.py
82

Triggering

85

this should be removed I think

93

same here

This revision is now accepted and ready to land.Dec 6 2019, 1:21 PM

Adapt according to review

Adapt according to review (i missed one)

  • Fix test on cli (forgot to amend the test after changing the cli's help message)
  • Use pytest-mock's mocker fixture in tests needing to patch behavior
requirements-test.txt
1

It's packaged in debian stable so ok: python3-pytest-mock ;)

swh/loader/tests/test_cli.py
80

Still this one to replace with mocker fixture

Migrate last test with mocker fixture (missed)