Skip to content

Commit 5a96986

Browse files
authored
Updated documentation: Contributing section (#212)
* Updated contributing section: How to debug the library locally * Updated contributing section: How to debug the library locally * Updated contributing section
1 parent d302083 commit 5a96986

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,41 @@ The project is following Network to Code software development guidelines and is
313313
4. Update the `unit/test_e2e.py` with the new provider, providing some data to test and validate the final `Maintenances` created.
314314
5. **Expose the new `Provider` class** updating the map `SUPPORTED_PROVIDERS` in `circuit_maintenance_parser/__init__.py` to officially expose the `Provider`.
315315

316+
### How to debug circuit-maintenance-parser library locally
317+
318+
1. `poetry install` updates the library and its dependencies locally.
319+
2. `circuit-maintenance-parser` is now built with your recent local changes.
320+
321+
If you were to add loggers or debuggers to one of the classes:
322+
323+
```python
324+
class HtmlParserZayo1(Html):
325+
def parse_bs(self, btags: ResultSet, data: dict):
326+
"""Parse B tag."""
327+
raise Exception('Debugging exception')
328+
```
329+
330+
After running `poetry install`:
331+
332+
```
333+
-> % circuit-maintenance-parser --data-file ~/Downloads/zayo.eml --data-type email --provider-type zayo
334+
Provider processing failed: Failed creating Maintenance notification for Zayo.
335+
Details:
336+
- Processor CombinedProcessor from Zayo failed due to: Debugging exception
337+
```
338+
339+
> Note: `invoke build` will result in an error due to no Dockerfile. This is expected as the library runs simple pytest testing without a container.
340+
341+
```
342+
-> % invoke build
343+
Building image circuit-maintenance-parser:2.2.2-py3.8
344+
#1 [internal] load build definition from Dockerfile
345+
#1 transferring dockerfile: 2B done
346+
#1 DONE 0.0s
347+
WARNING: failed to get git remote url: fatal: No remote configured to list refs from.
348+
ERROR: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1243547759/Dockerfile: no such file or directory
349+
```
350+
316351
## Questions
317352

318353
For any questions or comments, please check the [FAQ](FAQ.md) first and feel free to swing by the [Network to Code slack channel](https://networktocode.slack.com/) (channel #networktocode).

0 commit comments

Comments
 (0)