Page MenuHomeSoftware Heritage

(Re-)add tests for the loader.
ClosedPublic

Authored by vlorentz on Tue, Dec 4, 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 Loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vlorentz created this revision.Tue, Dec 4, 3:47 PM
ardumont accepted this revision.Tue, Dec 4, 5:15 PM
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.Tue, Dec 4, 5:15 PM
vlorentz marked an inline comment as done.Tue, Dec 4, 6:37 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!

ardumont added inline comments.Wed, Dec 5, 9:28 AM
swh/loader/core/tests/test_loader.py
58

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

This revision was automatically updated to reflect the committed changes.