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

Mango text index test fixes #894

Merged
merged 9 commits into from
Oct 17, 2017

Conversation

willholley
Copy link
Member

Overview

The text index tests are not run routinely because CouchDB doesn't natively support them. This PR corrects some bad assertions as a result of recent improvements/fixes to Mango and ensures that all of the expected tests are run.

Testing recommendations

Run the test suite with and without text index support.

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;

Copy link
Member

@garrensmith garrensmith left a comment

Choose a reason for hiding this comment

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

+1 nice work

self.db.create_index(["name", "location", "user_id"], ddoc="aaa")
self.db.create_index(["name", "age", "user_id"], ddoc="bbb")
self.db.create_index(["name", "age", "user_id"], ddoc="aaa")
self.db.create_index(["name", "age"], ddoc="_design/bbb")
Copy link
Member

Choose a reason for hiding this comment

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

This test is failing. you don't need the _design here.

@willholley willholley force-pushed the mango_fix_text_index_tests branch 2 times, most recently from 7588d7a to 30a5959 Compare October 17, 2017 13:41
Index selection tests behave differently
depending on which index types are available.

This splits the tests into 2 suites (with some overlap):

JSONIndexSelectionTests - tests that should run with no text indexes
TextIndexSelectionTests - tests that should run with text indexes

Previously, if text indexes were available they would always
be used, effectively causing us to skip testing the situation
where they were not available.
Skip operator tests that fail when text indexes are used.

Ideally these would be consistent across all index types but
they are not today.
Previously the text tests were run if the working directory
was "test" and the dreyfus source code was detected in the
CouchDB checkout directory. Instead, allow an environment
variable to be specified to toggle whether text index
support is available or not.
Some of the test fixtures were not being picked up
automatically because they didn't have "test" in the
filename or fixture name. This standardizes the file
naming to ensure we always run all the mango tests.
These tests were not running previously and were incorrect.
This fixes the assertions so that they match the expected
behaviour which changed in #816.
@willholley willholley merged commit 464a6b1 into apache:master Oct 17, 2017
wohali pushed a commit that referenced this pull request Oct 19, 2017
* Split out text index selection tests
* Skip operator tests that do not apply to text indexes
* Only run array length tests against text indexes
* Fix index crud tests when text indexes available
* Use environment variable to switch on text tests
* Fix incorrect text sort assertion in test
* Always use -test in fixture filename
* Fix index selection test compatibility with #816.
* Improve test README
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