Changeset View
Changeset View
Standalone View
Standalone View
docs/tutorial.rst
Show First 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | |||||
^^^^^^^^^^^^ | ^^^^^^^^^^^^ | ||||
First, when retrieving page results, which involves some protocols and parsing logic, | First, when retrieving page results, which involves some protocols and parsing logic, | ||||
please make sure that any deviance from what was expected will result in an | please make sure that any deviance from what was expected will result in an | ||||
informational error. You also have to simplify the results, both with filtering request | informational error. You also have to simplify the results, both with filtering request | ||||
parameters if the service supports it, and by extracting from the response only the | parameters if the service supports it, and by extracting from the response only the | ||||
information needed into a structured page. This all makes for easier debugging. | information needed into a structured page. This all makes for easier debugging. | ||||
Misc files | |||||
^^^^^^^^^^^^^^^ | |||||
There are also a few files that need to be modified outside of the lister directory, namely: | |||||
* `/setup.py` to add your lister to the end of the list in the *setup* section: | |||||
entry_points=""" | |||||
[swh.cli.subcommands] | |||||
lister=swh.lister.cli | |||||
[swh.workers] | |||||
lister.bitbucket=swh.lister.bitbucket:register | |||||
lister.cgit=swh.lister.cgit:register | |||||
...""" | |||||
* `/swh/lister/tests/test_cli.py` to get a default set of parameters in scheduler-related tests. | |||||
* `/README.md` to reference the new lister. | |||||
ardumont: great ;) | |||||
* `/CONTRIBUTORS` to add your name. | |||||
Testing your lister | Testing your lister | ||||
------------------- | ------------------- | ||||
When developing a new lister, it's important to test. For this, add the tests | When developing a new lister, it's important to test. For this, add the tests | ||||
(check `swh/lister/*/tests/`) and register the celery tasks in the main | (check `swh/lister/*/tests/`) and register the celery tasks in the main | ||||
conftest.py (`swh/lister/core/tests/conftest.py`). | conftest.py (`swh/lister/core/tests/conftest.py`). | ||||
Another important step is to actually run it within the docker-dev | Another important step is to actually run it within the docker-dev | ||||
Show All 11 Lines |
great ;)