Page MenuHomeSoftware Heritage

Make tests actually run.
ClosedPublic

Authored by vlorentz on Dec 20 2018, 7:55 PM.

Details

Summary

assertions in 'for indexed_data in actual_results:' never ran, because
'actual_results' was empty.

This commit creates two test failures, that are caused by an already
existing bug in the ctags indexer that I will fix later.

Diff Detail

Repository
rDCIDX Metadata indexer
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

  • remove debugging statement.

The control flow of the assert_results_ok function is really hard to follow.

It'd be nicer to have two functions, one for the current format and another for the legacy format (assert_legacy_results_ok).

This would also have the side effect of properly testing whether the results are in the expected (old or new) format.

WDYT?

swh/indexer/tests/test_utils.py
494

What's the task reference for the update to the new format?

In D876#18785, @olasd wrote:

The control flow of the assert_results_ok function is really hard to follow.

It'd be nicer to have two functions, one for the current format and another for the legacy format (assert_legacy_results_ok).

This would also have the side effect of properly testing whether the results are in the expected (old or new) format.

WDYT?

agreed. will do

swh/indexer/tests/test_utils.py
494
swh/indexer/tests/test_utils.py
494

I meant to reference it in the comment ;)

  • linearize assert_results_ok.
swh/indexer/tests/test_utils.py
477–478

If you want to go that way, I'd rather make that attribute default to False, leaving legacy indexer test classes override it, than making it an abstract property with a hack.

Did I ever tell you how I hate pretty much everything about abc? :-)

  • Default value for legacy_get_format.
This revision is now accepted and ready to land.Dec 21 2018, 4:33 PM
This revision was automatically updated to reflect the committed changes.