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

The method getTestSuitesForPlan() doest not return continuationToken when it's needed #609

Open
Luzhmf opened this issue Sep 19, 2024 · 1 comment

Comments

@Luzhmf
Copy link

Luzhmf commented Sep 19, 2024

Environment

Node version: v21.6.1
Npm version: 10.4.0
OS and version: Windows 11
azure-devops-node-api version: 14.0.2

Issue Description

I'm trying to retrieve test suites from a test plan which have 280 test suites.
I need to use the continuationToken as described at the code, but the method getTestSuitesForPlan() always returning the propertie undefined.
I took a look at the headers from the api response and the continuation token is there,

Expected behaviour

If the response for getTestSuites have "x-ms-continuationtoken" header, the PagedList.continuationToken should be set with this value to allow continue to get the test suites.

Actual behaviour

The property continuationToken is always being received as 'undefined'.

Steps to reproduce

  1. Try to get test suites from a test plan with more than 200 test suites inside.
  2. Try to continue retrieving the test suites using the continuationToken
@adelisle
Copy link

This is easy to fix, however it must be fixed on the side of the code generation as the bug appears to be in the generated code.
I haven't found where the upstream is to apply this fix myself.

Here is an example that I have tested, and verified to be working as expected, for ReleaseAPI :

diff --git a/api/ReleaseApi.ts b/api/ReleaseApi.ts
index 7c387e7..8face38 100644
--- a/api/ReleaseApi.ts
+++ b/api/ReleaseApi.ts
@@ -220,6 +220,8 @@ export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi {
                                               ReleaseInterfaces.TypeInfo.ReleaseApproval,
                                               true);
 
+                ret.continuationToken = res.headers['x-ms-continuationtoken']
+
                 resolve(ret);
                 
             }
@@ -1121,6 +1123,8 @@ export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi {
                                               ReleaseInterfaces.TypeInfo.ReleaseDefinition,
                                               true);
 
+                ret.continuationToken = res.headers['x-ms-continuationtoken']
+
                 resolve(ret);
                 
             }
@@ -1300,6 +1304,8 @@ export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi {
                                               ReleaseInterfaces.TypeInfo.Deployment,
                                               true);
 
+                ret.continuationToken = res.headers['x-ms-continuationtoken']
+
                 resolve(ret);
                 
             }
@@ -2999,6 +3005,8 @@ export class ReleaseApi extends basem.ClientApiBase implements IReleaseApi {
                                               ReleaseInterfaces.TypeInfo.Release,
                                               true);
 
+                ret.continuationToken = res.headers['x-ms-continuationtoken']
+
                 resolve(ret);
                 
             }

Looking forward to a quick resolution to this stagnant and long-standing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants