-
Notifications
You must be signed in to change notification settings - Fork 266
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
Fix using limit=0 and details=on to get only the count of elements #1492 #3994
Fix using limit=0 and details=on to get only the count of elements #1492 #3994
Conversation
This PR should include .test files to cover the cases described in #1492 (comment) In addition, some existing .test are failing. They has to be reviewed and fixed. |
Added new .test file and fixed existing .test are which are failing. |
Reviwing this PR I have realized that in line L161
should be changed to a more precise message:
Could you do that change in the PR, please? |
"code": "400", | ||
"details": "Bad pagination limit: /000000/ [a value of ZERO is unacceptable]", | ||
"details": "JSON Parse Error", |
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.
"JSON Parse Error" doesn't seem to be a right message in this case, as actually the request in step 3 doesn't have any payload...
In fact, a OK response seems to be better.
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.
"JSON Parse Error" doesn't seem to be a right message in this case, as actually the request in step 3 doesn't have any payload...
In fact, a OK response seems to be better.
In step 3 everything is OK but it shows "JSON Parse Error". I didn't find reason for this error. Could you please suggest what modification should be done in this test case?
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.
I understand that the response in this case should be the same you get when do a /v1/queryContext operation without any matching result. You can test yourself using this curl:
curl -vvv localhost:1026/v1/queryContext -H 'content-type: application/json' -d @- <<EOF
{
"entities": [
{
"type": "foo",
"isPattern": "false",
"id": "bar"
}
]
}
EOF
You should get something like this:
< HTTP/1.1 200 OK
< Connection: Keep-Alive
< Content-Length: 70
< Content-Type: application/json
< Fiware-Correlator: aaee0e26-4621-11ec-9ae3-000c29583ca5
< Date: Mon, 15 Nov 2021 14:38:15 GMT
<
* Connection #0 to host localhost left intact
{"errorCode":{"code":"404","reasonPhrase":"No context element found"}}
The expectation in the step should resemble that. The reason behind the "JSON Parser Error" in this case should be analyzed.
...the_count_of_elements/using_limit=0_and_options=count_to_get_only_the_count_of_elements.test
Outdated
Show resolved
Hide resolved
...the_count_of_elements/using_limit=0_and_options=count_to_get_only_the_count_of_elements.test
Outdated
Show resolved
Hide resolved
Fix in 8879a39 |
Note that the PR is not passing code style check at the present point. It seems the problems is:
|
Fixed in 64cf793 |
@Anjali-NEC taking into account the upcoming FIWARE TSC on Orion, could you provide an status update of this PR (or be prepared to attend to the TSC and report at the meeting), please? Thanks! |
@fgalan Gentle Reminder!!! |
test/functionalTest/cases/1492_limit_zero/limit_zero_entities.test
Outdated
Show resolved
Hide resolved
I have done a new round of review. The PR looks better than last time. Congrats :) However, there are new comments that need to be addressed. The main one is this: #3994 (comment), but the other are also important, related with indent, unnecessary whitelines, etc. |
In adddition, the coflict in CHANGES_NEXT_RELEASE should be solved, so functional tests get another pass. |
The two test cases are still failing:
|
I have had a look to the limit_zero_entities.test and limit_zero_types.test and they seems to be correct, so it seems there is some fail in your implementation. Could you review it and fix, please? |
Hi @fgalan Sir, Now all test cases are pass in my latest commit ff2b225. Please review it and if it is ok please merge it into master. |
@fgalan Gentle Reminder!! |
Hi @fgalan Sir, |
Work is not finished, but let's merge in pre-landing branch (issue1492-prelanding) to get easy further analysis and modifications. |
Continues in PR #4104 |
Fix issue #1492