From 82f9c74ff627f918c0c84433075c9111d0c3bdbf Mon Sep 17 00:00:00 2001 From: "Chang, Hui-Tang" Date: Tue, 26 Nov 2024 14:25:12 +0800 Subject: [PATCH 1/2] test(integration): fix test cases for integrations --- integration-test/pipeline/rest-integration.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/integration-test/pipeline/rest-integration.js b/integration-test/pipeline/rest-integration.js index 7335cc1c6..27f1d2ea3 100644 --- a/integration-test/pipeline/rest-integration.js +++ b/integration-test/pipeline/rest-integration.js @@ -27,8 +27,16 @@ export function CheckIntegrations() { }); var id = "github"; - var cdef = http.request("GET", `${pipelinePublicHost}/v1beta/connector-definitions/${id}`, null, null). - json().connectorDefinition; + var cdefs = http.request("GET", `${pipelinePublicHost}/v1beta/component-definitions?pageSize=100`, null, null). + json().componentDefinitions; + + var cdef = null; + for (var i = 0; i < cdefs.length; i++) { + if (cdefs[i].id === id) { + cdef = cdefs[i]; + break; + } + } var integration = { uid: cdef.uid, @@ -45,7 +53,7 @@ export function CheckIntegrations() { var oAuthConfig = { authUrl: "https://github.com/login/oauth/authorize", accessUrl: "https://github.com/login/oauth/access_token", - scopes: ["repo", "write:repo_hook"], + scopes: ["repo", "admin:repo_hook"], }; // Basic view From a3b4be8994b9f4d3896066ef39e257cfe9343818 Mon Sep 17 00:00:00 2001 From: "Chang, Hui-Tang" Date: Tue, 26 Nov 2024 14:39:13 +0800 Subject: [PATCH 2/2] use filter in component-definitions query --- integration-test/pipeline/rest-integration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/pipeline/rest-integration.js b/integration-test/pipeline/rest-integration.js index 27f1d2ea3..9455dd69b 100644 --- a/integration-test/pipeline/rest-integration.js +++ b/integration-test/pipeline/rest-integration.js @@ -27,7 +27,7 @@ export function CheckIntegrations() { }); var id = "github"; - var cdefs = http.request("GET", `${pipelinePublicHost}/v1beta/component-definitions?pageSize=100`, null, null). + var cdefs = http.request("GET", `${pipelinePublicHost}/v1beta/component-definitions?filter=qTitle="GitHub"`, null, null). json().componentDefinitions; var cdef = null;