New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes file count in dashboard AdminSets #3154
Conversation
@kdid The issue being fixed here mentions a limit of 10 files being reported. Could you please add a test that shows a count > 10? |
@cjcolvar - I made an adjustment. Will this do it? |
@kdid I'm having difficulty seeing how the spec actually tests the cause of the bug you are fixing to verify the fix. It appears to me that this is mocking out the search to provide results, but the search itself was the problem. I want to make sure that the specs are actually doing a meaningful test. Can you clarify? |
@laritakr - What do you recommend? The initial problem was that the code did not do an actual search for files in each AdminSet, but instead just counted whatever files happened to be contained in the first 10 rows of the search result that was designed to get the work count. (which is why it generally was 10 files but could have been more or less than 10 files depending on how many happened to be attached to those 10 works). So now the |
My approach would be to try to create solr docs only for the searches, and not the actual active fedora objects. I assume that only solr is needed for the searches. To be useful, the admin set service specs should verify that it can actually perform a search. From what I see, it is not testing returning an actual count of works or files, but it DOES query for admin sets. If the admin set service is adequately tested, anywhere else in the code should be able to safely mock out the search results or create the bare minimum objects, and not have to test the search service itself. (You definitely don't want to test 10+ files in the feature spec where you are actually creating the objects). |
@kdid you might want to look at how the collection_size_service_spec is setting up the solr docs for the specs and mimic that. |
a04b5b0
to
294d97f
Compare
Fixes #446
@samvera/hyrax-code-reviewers