-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Feature/delete rec additional test data set #133
Feature/delete rec additional test data set #133
Conversation
Do I need to do anything here? |
Maybe answer the question from 132,start fix with max keywords and set if the test separation is correct? |
Answered. Please check https://travis-ci.org/jarun/Buku/jobs/213773882 I think the API delete_rec() is not even called. |
You are right, I will fix it in next commit |
try it once again, and imo it should be 4 instead of 3 e.g. bdb.delete_rec(is_range=True, low=2, high='max')
# should be equal to
bdb.delete_rec(is_range=True, low=2, high=4)
# as in range(2, 4) -> [2, 3]
#
# but if high=3
bdb.delete_rec(is_range=True, low=2, high=3)
# equal to range(2,3) -> [2] |
The query we are using is:
So it will delete both 2 and 3 when you pass 2, 3. It doesn't work exactly like range() in this case. |
Travis failed. Can you please explain the test case:
What do you pass here? How many records in DB? What is max? What are you expecting as output? |
https://travis-ci.org/jarun/Buku/jobs/214497928#L614 it expect the database to be cleared. even when
i thought you expect
e:
still 3, maybe i will add after testing |
Initially when I mentioned max I intended MAX_INT. I understand now we refer to max_id in DB as max. So what is the integer value of max in the test case? Is it 3 (as you have 3 records in the DB)? If you pass: -1, 0, 3, True Are you expecting the same output? |
it is my misunderstanding. i thought string and yes the actual value of
for this
yes, just as you said.
|
So I guess you have to change max to len(records_in_DB) in the test cases, right? I think the ones with max are failing. |
I believe the following test cases are sufficient to test delete_rec with non-int:
The other test cases redundantly test the same paths and increase the time required to complete the tests. I think we should resort to intelligent manually built up test cases than going for matrix based brute-force test. For another example, I see tons of |
i have the same problem too. so today i actually look up for python-hypothesis and use it on test. with this i found a bug regarding big integer with 2 situations
i will change the test with other things is about test package. the current test packages are put on two place, travis and |
Sure! |
ok, i will do it. please fix the loop for e: i am wrong with to merge these travis and setup, i have to add extras in relate so http://stackoverflow.com/a/18879288/1766261 it is working on travis, but not on zsh(i will fiind out later) e2: for zsh the command is |
13153e1
to
a160a6b
Compare
What's the issue with that? |
Why are you using |
i am trying to recreate the same OverflowError issue with index. but it can't be tested because this part of the code for index in range(low, high + 1):
self.compactdb(index, delay_commit=True) when high value is unnecessarily high enough this will take time and and cause the error on travis. travis will raise error when a test case don't respond after ~10m here is similar sqlite issue which happen to django https://code.djangoproject.com/ticket/27397 the actual number of MAX_SQLITE_INT is |
d2d2b6e
to
1eba948
Compare
- remove skip - use constant value instead sys.maxsize - fix assert
Thanks for the investigation! Let's pass MAX_SQLITE_INT. I can add a check before range but I believe we may never hit this issue in reality. |
Also, please reduce the number of tests for I'm even thinking of removing the non-int case because we are clear we want integers. Feel free to take a call on this. |
3b4cf59
to
1eeac89
Compare
i did several skip, but unfortunately skip + parametrize isnt working on py3.3 and py3.4, possibly related to this pytest-dev/pytest#1296 i think this is finished, right? next would be
e:
imo it is better to fix this. even if the number will not met in reality, any high number input will make program take unnecessary time to process |
As I mentioned earlier, we should reduce the test cases for delete_rec with non-int to just 3 cases:
rest of the cases are redundant. |
Thank you! |
yes, please proceed. |
* new: test: additional data test set. * new: test: test on non integer. * chg: test: rename function for consistency. * chg: test: change normalize function. * chg: test: change max value for high var * fix: test: use normalized index * fix: test: remove 'max' as valid value * chg: test: use hypothesis to test delete_rec index * new: test: add hypothesis package * chg: test: use hypothesis to test delete_rec index * chg: test: add hypothesis to travis * chg: test: limit integer test. * chg: dev: remove unused test * fix: test: fix test on non integer. * new: test: add big integer test on range in delete_rec method. * fix: test: fix high low diff * fix: test: skip only for python<3.5 * chg: test: change test_delete_rec_range_and_big_int - remove skip - use constant value instead sys.maxsize - fix assert * chg: test: use setup.py to manage test package instead travis * chg: test: add tests extras on setup.py * chg: test: change install test package. * fix: test: fix whitespace * fix: test: MAX_SQLITE_INT value * chg: test: skip test for python<3.5 * fix: test: fix import * chg: test: skip Impossible test * chg: test: simplify test_delete_rec_on_non_interger
* new: test: test for delete_rec (#132) * chg: dev: add db instance for delay_commit check * chg: dev: remove unused delete_rec test * chg: test: not check delay commit on empty db test. * chg: test: use simpler precise test for delete_rec * fix: test: change pytest parametrize arg * fix: test: fix instance of BukuDb * fix: test: fix test. * fix: test: logic on expected db len * new: test: test for delete_rec * new: test: test for delete_rec on empty database * Needs timely commitment. Removing the base implementation for rest APIs. At this point I believe it will Be better handled by someone who needs it. The current contributions in this area are very very infrequent. Defects and PRs remain pen over fortnights. It's difficult to expect the same team to maintain the piece of code even if we ever receive the full implementation from them. * Roll ToDo list * Feature/delete rec additional test data set (#133) * new: test: additional data test set. * new: test: test on non integer. * chg: test: rename function for consistency. * chg: test: change normalize function. * chg: test: change max value for high var * fix: test: use normalized index * fix: test: remove 'max' as valid value * chg: test: use hypothesis to test delete_rec index * new: test: add hypothesis package * chg: test: use hypothesis to test delete_rec index * chg: test: add hypothesis to travis * chg: test: limit integer test. * chg: dev: remove unused test * fix: test: fix test on non integer. * new: test: add big integer test on range in delete_rec method. * fix: test: fix high low diff * fix: test: skip only for python<3.5 * chg: test: change test_delete_rec_range_and_big_int - remove skip - use constant value instead sys.maxsize - fix assert * chg: test: use setup.py to manage test package instead travis * chg: test: add tests extras on setup.py * chg: test: change install test package. * fix: test: fix whitespace * fix: test: MAX_SQLITE_INT value * chg: test: skip test for python<3.5 * fix: test: fix import * chg: test: skip Impossible test * chg: test: simplify test_delete_rec_on_non_interger * Feature/tox test (#138) * chg: test: mark slow test * new: test: config for tox * chg: test: mark function as non tox * new: test: test print_rec with hypothesis * chg: test: simplify test for print_single_rec * fix: test: fix index test on test_print_rec_hypothesis * fix: test: fix tox setting. * fix: test: change test_print_single_rec to python3.5 only
mostly about non integer input and 'max' keyword input.
related #132