Page MenuHomeSoftware Heritage

(Re-)add tests for the loader.
ClosedPublic

Authored by vlorentz on Dec 4 2018, 3:47 PM.

Details

Summary

When doing D682, I misunderstood how batching in the loader worked,
so I ended up making these tests useless.

This makes them do their job again, and tests more cases, such as
the threshold being reached.

It also makes the cascading more explicit by having more compact
and documented tests.

Diff Detail

Repository
rDLDBASE Generic VCS/Package Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont added a subscriber: ardumont.

Also, since every jenkins job in loaders will break anyway...

If you have better proposition names than SWHLoader and SWHStatelessLoader, i'd glad to hear it ;)

swh/loader/core/tests/test_loader.py
174

fyi, the legacy docstring is wrong.
stateless loader is not supposed to use the maybe_load methods.
They are the ones accumulating state.

That's why the split in 2 tests here (one statefull is calling maybe_load_*, the other one stateless is calling send_*).

This revision is now accepted and ready to land.Dec 4 2018, 5:15 PM
vlorentz added inline comments.
swh/loader/core/tests/test_loader.py
174

Ah, that explains why I could not make sense of that docstring

If you have better proposition names than SWHLoader and SWHStatelessLoader, i'd glad to hear it ;)

respectively BufferedLoader and UnbufferedLoader?

respectively BufferedLoader and UnbufferedLoader?

Thank you, it's rather to the point!

swh/loader/core/tests/test_loader.py
57

from D768#inline-4163: something like this ;)

This revision was automatically updated to reflect the committed changes.