-
Notifications
You must be signed in to change notification settings - Fork 55
Fixed the bug where design doc was created in CouchDB 3.0 with partition enabled even when the partition flag was false #467
Conversation
…n when partition flag was false
…cument_partitioning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just one change before approving
tests/unit/design_document_tests.py
Outdated
@@ -161,6 +161,32 @@ def test_update_design_document_with_encoded_url(self): | |||
remote_ddoc.fetch() | |||
self.assertEqual(remote_ddoc, ddoc) | |||
|
|||
def test_correct_design_document_partitioning(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's split this into two test functions: test_design_document_with_partitioned_true
and test_design_document_with_partitioned_false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The split is done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, please address the comments in CHANGES.
The build is currently failing. Our team will need to review and fix the errors before merging this PR.
CHANGES.md
Outdated
@@ -1,3 +1,7 @@ | |||
# 2.14.0 (2020-05-07) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the version to # UNRELEASED
. Our team will update this when we release a new version of python-cloudant
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done the changes
CHANGES.md
Outdated
@@ -1,3 +1,7 @@ | |||
# 2.14.0 (2020-05-07) | |||
|
|||
- [FIXED] Creating design documents with appropriate partition flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update this to:
- [FIXED] Set default value for `partitioned` parameter to false when creating a design document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the update in CHANGES.md
@emlaver I checked the Travis logs and looks like the tests are failing because of the newly added default "options" for partition=false is not taken into account into those failing tests.. |
….py design_document_tests.py
@CodipherX Thanks for your hard work! I'll squash and merge this |
Checklist
CHANGES.md
|CHANGELOG.md
) or test/build only changesDescription
In CouchDB 3.0.0, when attempting to create a design document with
partitioned=false
, the cloudant still creates the design doc withpartitioned=true
Fixes #466
Approach
In the src/cloudant/design_document.py, in the
__init__
function, the partition options were being set only whenpartition=true
.I added an else clause to set partition option when partition flag is
false
.Schema & API Changes
No change
Security and Privacy
No change
Testing
Old commit
Modified existing test design_document_tests.py because it already contains relevant tests for unit testing. Added the new test function
test_correct_design_document_partitioned_true
andtest_correct_design_document_partitioned_false
Latest commit
Modified existing test database_partition_tests.py because it already contains the test for partitioned design doc (
test_create_partitioned_design_document
). Added the new test function for non-partitioned design doctest_create_non_partitioned_design_document
. Reversed the changes in design_document_tests.py made in old commit.Also updated design_document_tests.py and database_tests.py for checking partition value while validation
Monitoring and Logging
No change