Closed mdorf closed 7 years ago
misha [11:37 AM] ok, I’ve spent some more time digging into this because it deeply troubled me having unexpected failures in tests whose code should not’ve been affected
[11:37] I believe the problem is in the solr API that we’re using.
[11:38] The rsolr module got upgraded from 1.1.2 to 2.0.0
[11:39] and it looks like it changed the behavior of empty array values
[11:40] in 1.1.2, when you send in an array that looks like [“”], the value is being ignored
[11:40] in 2.0.0. that safety check no longer appears to be in place, and the array is treated as “non-empty”
[11:41] the code that I added to the indexing module will handle this case, so I think all is well with this case
The test test_search_other_filters suddenly started failing on line 106:
https://github.com/ncbo/ontologies_api/blob/staging/test/controllers/test_search_controller.rb#L106
The test fails because it returns 27 records instead of the expected 26. The extra record contains an empty definition:
I've patched the code on the search side to ignore empty elements inside arrays when indexing, but the circumstances remain suspicious, since the test ontology itself has not changed, and neither did the original test.