- Notifications
You must be signed in to change notification settings - Fork217
Added extract all parameter to test_plan_client method#515
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:dev
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
@@ -361,6 +361,9 @@ def get_test_suites_for_plan(self, project, plan_id, expand=None, continuation_t | |||
version='7.0', | |||
route_values=route_values, | |||
query_parameters=query_parameters) | |||
if extract_all and 'x-ms-continuationtoken' in response.headers: | |||
continuation_token = response.headers['x-ms-continuationtoken'] | |||
return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + self.get_test_plans(project, plan_id, expand=expand, continuation_token=continuation_token, as_tree_view=as_tree_view, extract_all=True) |
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 response is being deserialized usingself._deserialize('[TestPlan]', ...)
. I believe this should beself._deserialize('[TestSuite]', ...)
to match the method's return type and the API response structure.
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.
Also the recursive call is made toself.get_test_plans(...)
. I believe it should be callingself.get_test_suites_for_plan(...)
to fetch the next page of test suites. If i am correct (which i might not be) then due to calling the wrong method (get_test_plans
), the arguments are mismatched.plan_id
is passed whereowner
is expected.
As I was using the library I realized that I was not getting all test suites of my project. After a fast search I found that the API only returns stacks of 200 records.
When using the "get_test_suites_for_plan" method I can pass the "continuation_token" but there is not a easy way of obtaining this token unless duplicating the method.
I suggest to add a parameter to automatically call the API multiple times when a continuation token is returned by the API.
This can be applied to other methods like "get_test_plans" and maybe it must be replicated to the other "test_plant_client.py" classes.