@camunda/e2e-test-suite 0.0.760 → 0.0.761
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.
|
@@ -4,7 +4,6 @@ const _8_9_1 = require("../../../fixtures/8.9");
|
|
|
4
4
|
const UtilitiesPage_1 = require("../../../pages/8.9/UtilitiesPage");
|
|
5
5
|
const _setup_1 = require("../../../test-setup.js");
|
|
6
6
|
const apiHelpers_1 = require("../../../utils/apiHelpers");
|
|
7
|
-
const sleep_1 = require("../../../utils/sleep");
|
|
8
7
|
const users_1 = require("../../../utils/users");
|
|
9
8
|
const test_1 = require("@playwright/test");
|
|
10
9
|
const testUser = (0, users_1.getTestUser)('fourteenthUser');
|
|
@@ -23,8 +22,11 @@ _8_9_1.test.describe('Orchestration Cluster MCP Server - Process Instance Tools
|
|
|
23
22
|
throw new Error('Failed to deploy process instance tools processes');
|
|
24
23
|
}
|
|
25
24
|
const testInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(testFileProcessKey), authToken, 'saas', 'agentic_cluster');
|
|
26
|
-
// Wait for test instance to be
|
|
27
|
-
|
|
25
|
+
// Wait for the test instance to be exported to secondary storage before the
|
|
26
|
+
// tools instance queries it via the getProcessInstance MCP tool. That tool
|
|
27
|
+
// wraps GET /v2/process-instances/{key}, which is eventually consistent and
|
|
28
|
+
// returns 404 until the Camunda Exporter syncs — a fixed sleep is not enough.
|
|
29
|
+
await (0, apiHelpers_1.waitForProcessInstanceVisible)(String(testInstanceKey), authToken, 'saas', 'agentic_cluster');
|
|
28
30
|
toolsInstanceKey = await (0, apiHelpers_1.createProcessInstance)(String(toolsProcessKey), authToken, 'saas', 'agentic_cluster', { testFileProcessKey, testInstanceKey });
|
|
29
31
|
});
|
|
30
32
|
_8_9_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
|
|
@@ -17,6 +17,7 @@ export declare function validateMcpServerHealth(serverUrl?: string): Promise<API
|
|
|
17
17
|
export declare function waitForConnectorsReady(baseUrl?: string | undefined, timeoutMs?: number): Promise<void>;
|
|
18
18
|
export declare function deployProcess(filePath: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string): Promise<number | null>;
|
|
19
19
|
export declare function createProcessInstance(processDefinitionKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, variables?: Record<string, unknown>): Promise<string>;
|
|
20
|
+
export declare function waitForProcessInstanceVisible(processInstanceKey: string, authToken?: string, environment?: 'saas' | 'sm', clusterType?: string, maxAttempts?: number, retryDelayMs?: number): Promise<void>;
|
|
20
21
|
export declare function createJsonClusterVariable(authToken?: string, environment?: 'saas' | 'sm', customVariableName?: string, customVariableValue?: string, clusterType?: string): Promise<void>;
|
|
21
22
|
export declare function createStringClusterVariable(authToken?: string, environment?: 'saas' | 'sm', customVariableName?: string, customVariableValue?: string, clusterType?: string): Promise<void>;
|
|
22
23
|
interface ReportDefinition {
|
package/dist/utils/apiHelpers.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
6
|
+
exports.updateCollectionScope = exports.createSingleProcessReport = exports.createDashboard = exports.createCollection = exports.getOptimizeCookieSm = exports.getOptimizeCoockie = exports.createStringClusterVariable = exports.createJsonClusterVariable = exports.waitForProcessInstanceVisible = exports.createProcessInstance = exports.deployProcess = exports.waitForConnectorsReady = exports.validateMcpServerHealth = exports.authC8runAPI = exports.authSmAPI = exports.authSaasAPI = exports.authAPI = exports.buildZeebeApiUrl = exports.retryOn500 = exports.sendRequestAndAssertResponse = exports.assertResponseStatus = exports.getApiRequestContext = void 0;
|
|
7
7
|
const test_1 = require("@playwright/test");
|
|
8
8
|
const sleep_1 = require("./sleep");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -394,6 +394,31 @@ async function createProcessInstance(processDefinitionKey, authToken, environmen
|
|
|
394
394
|
return String(processInstanceKey);
|
|
395
395
|
}
|
|
396
396
|
exports.createProcessInstance = createProcessInstance;
|
|
397
|
+
// Poll the eventually-consistent GET /v2/process-instances/{key} endpoint until
|
|
398
|
+
// the instance has been exported to secondary storage (HTTP 200). Immediately
|
|
399
|
+
// after creation this endpoint returns 404 until the Camunda Exporter syncs,
|
|
400
|
+
// so callers that need the instance queryable by key (e.g. via the
|
|
401
|
+
// getProcessInstance MCP tool) must wait for it to become visible.
|
|
402
|
+
async function waitForProcessInstanceVisible(processInstanceKey, authToken, environment, clusterType, maxAttempts = 12, retryDelayMs = 5000) {
|
|
403
|
+
apiRequestContext = await getApiRequestContext();
|
|
404
|
+
const url = buildZeebeApiUrl(`/v2/process-instances/${processInstanceKey}`, environment, clusterType);
|
|
405
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
406
|
+
const response = await apiRequestContext.get(url, {
|
|
407
|
+
headers: {
|
|
408
|
+
Authorization: authToken ?? '',
|
|
409
|
+
},
|
|
410
|
+
});
|
|
411
|
+
if (response.status() === 200) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
if (attempt < maxAttempts) {
|
|
415
|
+
console.warn(`waitForProcessInstanceVisible: process instance ${processInstanceKey} not yet indexed (HTTP ${response.status()}), attempt ${attempt}/${maxAttempts}, retrying in ${retryDelayMs}ms`);
|
|
416
|
+
await (0, sleep_1.sleep)(retryDelayMs);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
throw new Error(`Process instance ${processInstanceKey} was not visible in secondary storage after ${maxAttempts} attempts.`);
|
|
420
|
+
}
|
|
421
|
+
exports.waitForProcessInstanceVisible = waitForProcessInstanceVisible;
|
|
397
422
|
async function createClusterVariableInternal(authToken, environment, variableName, variableValue, variableType, clusterType) {
|
|
398
423
|
// Retry on transient ingress / upstream errors (502/503/504) and on
|
|
399
424
|
// network-layer exceptions, which we have observed during nightly runs
|