-
Notifications
You must be signed in to change notification settings - Fork 336
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
Add tests for private search [OSF-6898] #6184
Add tests for private search [OSF-6898] #6184
Conversation
Figured I'd try running the existing
|
I've installed elasticsearch-head (h/t) to help debug issues trying to write an initial test for search. |
With 7ab64b2 I am seeing a "Foo Bar" project node in Mongo, but I'm not seeing a corresponding index entry in Elastic. Hmm ... |
Alright, so how does indexing work? |
Grepping suggests that the diff --git a/tests/factories.py b/tests/factories.py
index 303b740..9d2d492 100644
--- a/tests/factories.py
+++ b/tests/factories.py
@@ -100,6 +100,11 @@ class ModularOdmFactory(base.Factory):
class UserFactory(ModularOdmFactory):
+
+ def __init__(self, *a, **kw):
+ import pdb; pdb.set_trace()
+ super(UserFactory, self).__init__(*a, **kw)
+
class Meta:
model = User
abstract = False |
Serendipitously, grepping also leads me to |
Alright, so it seems that somehow factoryboy does not need to actually instantiate the |
Maybe there are no indices for projects? |
Search definitely includes projects: |
The project created in the test in 7ab64b2 is available locally by hitting its URL directly, but it's not showing up in search. |
I wasn't running celery or the apiserver! I'm running |
I'm seeing a search result through the web. I'm narrowing down the difference between there and the test case. |
Shaw 'nuff. I figured I'd use |
Similar behavior: I'm seeing both user and project (node) in Mongo, but only the user in Elastic. |
In my |
I find an |
I do end up inside |
Okay! Something wrong with Celery. If I run with |
Onward! |
Kicked out a new PR (#6197) for some refactoring to make room for the new tests. |
Second PR kicked out for refactoring: #6199. |
Rebased onto #6197. |
Okay! Wrapping up for the day. With the ground cleared, the next thing I want to wrap my head around is what is available to be searched (projects and users ... anything else?), and what the privacy options for each object are. I want to compile a systematic view of all of these options so that we can test them all. I expect to be back on Friday (three days hence). À bientôt! |
OSF-6898 says that the endpoint in view here is |
There's also In terms of scoping, it's easy enough to draw a line at SHARE search (does SHARE even have a concept of private data?). But a narrow interpretation of "Assume the existing search endpoint |
|
This is adequately covered by the subsequent check.
I was getting confused with that goofy default argument.
This way vim-pyflakes stops yelling quite so much.
Rebased, was 502779f. |
For the record, my contract with COS is up and we didn't renew for 2017, so this is ready for someone else to pick up! :-) |
Closing for now, as this has become stale. Will definitely refer back to this when we pick this feature back up. Thanks for your hard work, @whit537 ! |
← #6197
Purpose
This adds a suite of failing tests for the behavior we'd like to see from search over private data.
Changes
tbd
Side effects
tbd
Ticket
https://openscience.atlassian.net/browse/OSF-6898
Todo
improveAdd tests for private search [OSF-6898] #6184 (comment)mock_archive
comprehensively in a separate PR