@camunda/e2e-test-suite 0.0.1524 → 0.0.1525
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tests/8.10/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js
CHANGED
|
@@ -21,6 +21,7 @@ const _setup_1 = require("../../../../test-setup.js");
|
|
|
21
21
|
const apiHelpers_1 = require("../../../../utils/apiHelpers");
|
|
22
22
|
const constants_1 = require("../../../../utils/constants");
|
|
23
23
|
const mcpHelpers_1 = require("../../../../utils/mcpHelpers");
|
|
24
|
+
const sleep_1 = require("../../../../utils/sleep");
|
|
24
25
|
const users_1 = require("../../../../utils/users");
|
|
25
26
|
const testUser = (0, users_1.getTestUser)();
|
|
26
27
|
let suiteSetup;
|
|
@@ -47,21 +48,40 @@ _8_10_1.test.describe
|
|
|
47
48
|
suiteSetup ??= setupSuite();
|
|
48
49
|
await suiteSetup;
|
|
49
50
|
});
|
|
51
|
+
// deployProcess swallows errors and returns null, so a single request timeout
|
|
52
|
+
// on the cluster would otherwise fail setup. Redeploying identical BPMN is
|
|
53
|
+
// deduplicated by Camunda, so retrying is safe.
|
|
54
|
+
const deployWithRetry = async (filePath, attempts = 3) => {
|
|
55
|
+
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
56
|
+
const key = await (0, apiHelpers_1.deployProcess)(filePath, authToken, 'saas', 'agentic_cluster');
|
|
57
|
+
if (key != null)
|
|
58
|
+
return key;
|
|
59
|
+
if (attempt < attempts) {
|
|
60
|
+
console.warn(`deployWithRetry: ${filePath} failed (attempt ${attempt}/${attempts}), retrying`);
|
|
61
|
+
await (0, sleep_1.sleep)(5000 * attempt);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
50
66
|
const setupSuite = async () => {
|
|
51
67
|
authToken = await (0, apiHelpers_1.authSaasAPI)(undefined, 'agentic_cluster');
|
|
52
68
|
mcpProcessesUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/mcp/processes', 'saas', 'agentic_cluster');
|
|
53
69
|
messageSubscriptionsSearchUrl = (0, apiHelpers_1.buildZeebeApiUrl)('/v2/message-subscriptions/search', 'saas', 'agentic_cluster');
|
|
54
70
|
const apiContext = await (0, apiHelpers_1.getApiRequestContext)();
|
|
55
|
-
|
|
71
|
+
// A single slow response from the cluster (request timeout) must not fail
|
|
72
|
+
// the whole worker's setup, so retry the handshake.
|
|
73
|
+
await (0, test_1.expect)(async () => {
|
|
74
|
+
mcpSessionId = await (0, mcpHelpers_1.initializeMcpSession)(apiContext, mcpProcessesUrl, authToken, mcpSessionId);
|
|
75
|
+
}).toPass(constants_1.defaultAssertionOptions);
|
|
56
76
|
// Deploy independent processes concurrently to reduce beforeAll runtime.
|
|
57
77
|
// Process definitions are never deleted (the C8 REST API does not expose a
|
|
58
78
|
// deletion endpoint), so each run on the shared agentic cluster accumulates
|
|
59
79
|
// versions. Tests use regex matchers and subscription-key lookups rather
|
|
60
80
|
// than fixed names to stay robust across accumulated versions.
|
|
61
81
|
const [toolProcessKey, withInputsKey, plainKey] = await Promise.all([
|
|
62
|
-
(
|
|
63
|
-
(
|
|
64
|
-
(
|
|
82
|
+
deployWithRetry('./resources/mcp_server_saas/mcp_as_tool_process.bpmn'),
|
|
83
|
+
deployWithRetry('./resources/mcp_server_saas/mcp_as_tool_with_inputs.bpmn'),
|
|
84
|
+
deployWithRetry('./resources/mcp_server_saas/mcp_plain_process.bpmn'),
|
|
65
85
|
]);
|
|
66
86
|
if (toolProcessKey == null)
|
|
67
87
|
throw new Error('Failed to deploy mcp_as_tool_process.bpmn');
|
|
@@ -72,10 +92,10 @@ _8_10_1.test.describe
|
|
|
72
92
|
// Deploy v1 then v2 sequentially — order matters so version 2 is the latest.
|
|
73
93
|
// Camunda deduplicates identical BPMN content, so v1 and v2 differ only in
|
|
74
94
|
// their purpose property to force a genuine new version.
|
|
75
|
-
const v1Key = await (
|
|
95
|
+
const v1Key = await deployWithRetry('./resources/mcp_server_saas/mcp_as_tool_v1.bpmn');
|
|
76
96
|
if (v1Key == null)
|
|
77
97
|
throw new Error('Failed to deploy mcp_as_tool_v1.bpmn');
|
|
78
|
-
const v2Key = await (
|
|
98
|
+
const v2Key = await deployWithRetry('./resources/mcp_server_saas/mcp_as_tool_v2.bpmn');
|
|
79
99
|
if (v2Key == null)
|
|
80
100
|
throw new Error('Failed to deploy mcp_as_tool_v2.bpmn');
|
|
81
101
|
};
|