Skip to content
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

Refactor search tests #6197

Merged
merged 5 commits into from
Aug 29, 2016
Merged

Refactor search tests #6197

merged 5 commits into from
Aug 29, 2016

Conversation

chadwhitacre
Copy link
Contributor

@chadwhitacre chadwhitacre commented Aug 23, 2016

#6184

Purpose

Clean up our search test suite ahead of extending it with tests for private search (#6184).

Changes

There's nothing for QA to test

Side effects

n/a

Ticket

https://openscience.atlassian.net/browse/OSF-6928

- move test_elastic.py to test_search/test_elastic.py
- factor out test_search/test_views.py from test_views.py

def test_new_user(self):
# Verify that user has been added to Elastic Search
docs = query_user(self.user.fullname)['results']
assert_equal(len(docs), 1)
assert len(docs) == 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this change is not approved. Aside from the stylistic difference, the nose_asserts give more information than the bare asserts unless we are using pytest (which we do not). Please revert these back.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, rebased out in f0eec53.

@brianjgeiger
Copy link
Collaborator

Pass done. I'll do more once I have a significantly smaller diff to compare. 🐧 I didn't see anything else that went against our existing standards in a serious way, although we obviously won't want to have this PR hanging out too long or it will cause so many merge conflicts.

Let's do more of those! Ideally we'd remove the redundant "Factory" from
the classnames as well, but let's not get *too* uppity here. ;-)
We only need the requires_search decorator on the base class, not on
every subclass as well. Plus a couple bugfixes (tests weren't skipped
when they should've been).
@chadwhitacre
Copy link
Contributor Author

I'll do more once I have a significantly smaller diff to compare.

I made a PR for the first commit, since that was the bulk of the diff in terms of LOC though it's really a simple change. I've updated the description on this PR with a link to the diff between that and this. The individual commits are also suitable for viewing separately. ;-)

@brianjgeiger
Copy link
Collaborator

I wasn't super concerned about moving the search views to a new file, it was mostly all the asserts that were interspersed between things. This looks like it should be fine once tests pass. It's not going to get merged for at least a day or two, though, even if all is well.

@brianjgeiger
Copy link
Collaborator

Oh, and don't forget to use gitflow naming for branches: items for develop should be in a feature/feature-name branch, and items for master should be in a hotfix/hotfix-name. Don't change it for this, but in the future. Thanks!

@brianjgeiger
Copy link
Collaborator

The Changes section of the PR is in good part so QA can have a focused idea of where to poke at things. Please go ahead and summarize the types of changes for a non-developer technical audience on future PRs rather than pointing to another location. No need for this one because there shouldn't be anything for QA to do related to this PR.

@chadwhitacre
Copy link
Contributor Author

chadwhitacre commented Aug 23, 2016

I wasn't super concerned about moving the search views to a new file, it was mostly all the asserts that were interspersed between things. This looks like it should be fine once tests pass.

Okay, I've closed #6199 and the associated Jira ticket.

The Changes section of the PR is in good part so QA can have a focused idea of where to poke at things.

Ah, gotcha. So instead of a separate "QA notes" section (cf.), I will use "Changes" for that ... and I take it from your(?) edit of #5977 (comment) that "Side effects" is for the same audience, QA. 👍

@chadwhitacre
Copy link
Contributor Author

Oh, and don't forget to use gitflow naming for branches: items for develop should be in a feature/feature-name branch, and items for master should be in a hotfix/hotfix-name.

I just slowed down and actually read all of "A successful Git branching model" for the first time. Sounds like the original model was looser on naming conventions ("anything except [...]"), with the git-flow scripts enforcing a slightly modified convention, the one we seem to be using. I will endeavor to observe this convention with all diligence in the future!

@brianjgeiger
Copy link
Collaborator

Cool, thanks. We're not 100% gitflow, and it's more important with hotfixes, but it's a nice double-check even for feature branches.

@brianjgeiger brianjgeiger merged commit be98b71 into CenterForOpenScience:develop Aug 29, 2016
@chadwhitacre chadwhitacre deleted the search-tests-refactor branch August 29, 2016 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants