Page MenuHomeSoftware Heritage
Paste P1140

some basic pdb bootstrap example
ActivePublic

Authored by ardumont on Aug 31 2021, 9:52 AM.
... $ cd swh-loader-core
$ ...  master $$ arc patch D6158
$ ...  arcpatch-D6158 $ # edit swh/loader/package/loader.py and add some breakpoing
$ ...  arcpatch-D6158 $ grep -B25 -A2 pdb swh/loader/package/loader.py
...  arcpatch-D6158 $ pytest --log-level=debug --ff -x -vv -s swh/loader/package/jar/tests/test_jar.py -k test_jar_visit_with_release_artifact_no_prior_visit
============================================================================================================= test session starts =============================================================================================================
platform linux -- Python 3.7.3, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -- /home/tony/.virtualenvs/swh/bin/python3
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/tony/work/inria/repo/swh/swh-environment/swh-loader-core/.hypothesis/examples')
rootdir: /home/tony/work/inria/repo/swh/swh-environment/swh-loader-core, configfile: pytest.ini
plugins: xdist-1.32.0, celery-4.4.6, testinfra-5.2.1, postgresql-2.4.0, django-test-migrations-1.1.0, forked-1.2.0, asyncio-0.12.0, requests-mock-1.8.0, mock-3.1.1, dash-1.13.1, cov-2.11.1, django-3.9.0, flask-1.0.0, hypothesis-6.8.9, redis-2.0.0, kafka-0.4.0, swh.core-0.14.5.dev1+g67296ba, swh.journal-0.8.0
collected 3 items / 2 deselected / 1 selected
run-last-failure: rerun previous 1 failure first
swh/loader/package/jar/tests/test_jar.py::test_jar_visit_with_release_artifact_no_prior_visit create_plpgsql_language
----------------------------
language already installed
(1 row)
In get_versions [{'time': 1626109619335, 'url': 'https://repo1.maven.org/maven2/al/aldi/sprova4j/0.1.0/sprova4j-0.1.0.jar', 'gid': 'al.aldi', 'aid': 'sprova4j', 'filename': 'sprova4j-0.1.0.jar', 'version': '0.1.0'}]
In get_versions versions ['0.1.0']
In get_package_info 0.1.0
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[34] > /home/tony/work/inria/repo/swh/swh-environment/swh-loader-core/swh/loader/package/loader.py(369)download_package()
-> return data
5 frames hidden (try 'help hidden_frames')
(Pdb++) p data
[('/tmp/tmpxmrcwlh_/sprova4j-0.1.0.jar', {'length': 14316, 'filename': 'sprova4j-0.1.0.jar', 'checksums': {'sha256': 'e842741437ef876ba69986fa2719f34c4593615d6552de755020a6332a7ed7f6', 'sha1': '6976e186000753610a63713677f42f0228f04e64'}, 'url': 'https://repo1.maven.org/maven2/al/aldi/sprova4j/0.1.0/sprova4j-0.1.0.jar'})]
(Pdb++) p data