@camunda/e2e-test-suite 0.0.832 → 0.0.833

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.
@@ -1,4 +1,5 @@
1
1
  import { Page } from '@playwright/test';
2
2
  export declare function deleteClusterViaApi(page: Page, clusterName: string): Promise<void>;
3
3
  export declare function createClusterViaApi(page: Page, clusterName: string, region?: string): Promise<string>;
4
+ export declare function ensureClusterViaApi(page: Page, clusterName: string, region?: string): Promise<string>;
4
5
  export declare function waitForClusterHealthyViaApi(page: Page, clusterUuid: string, timeoutMs?: number): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitForClusterHealthyViaApi = exports.createClusterViaApi = exports.deleteClusterViaApi = void 0;
3
+ exports.waitForClusterHealthyViaApi = exports.ensureClusterViaApi = exports.createClusterViaApi = exports.deleteClusterViaApi = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("./sleep");
6
6
  const PLAN_TYPE_ID = '574cde5f-54ae-43c1-851a-e6fb4f03423a';
@@ -125,6 +125,28 @@ async function createClusterViaApi(page, clusterName, region = 'GCP') {
125
125
  return clusterId;
126
126
  }
127
127
  exports.createClusterViaApi = createClusterViaApi;
128
+ async function ensureClusterViaApi(page, clusterName, region = 'GCP') {
129
+ // Versions with more than one Tasklist-mode Playwright project (e.g. 8.8,
130
+ // 8.9's chromium-v1/chromium-v2) run test-setup.spec.ts once per project,
131
+ // concurrently, against the same org -- and both target a cluster with
132
+ // this same name. Deleting-then-recreating unconditionally here would race
133
+ // with the sibling project's setup: whichever one runs its delete second
134
+ // rips out the cluster the other project already started using, silently
135
+ // orphaning any process instances/jobs created on it in the meantime.
136
+ //
137
+ // Each PR/nightly run gets a brand-new, empty org (see the
138
+ // create-organization/delete-organization jobs), so within a single run a
139
+ // cluster with this name can only mean one thing: the sibling project's
140
+ // setup already created it. Adopt it instead of destroying it -- whichever
141
+ // project's setup gets here first "wins" and creates it, the other one
142
+ // just reuses it.
143
+ const existing = await findClusterByName(page, clusterName);
144
+ if (existing) {
145
+ return existing.uuid;
146
+ }
147
+ return createClusterViaApi(page, clusterName, region);
148
+ }
149
+ exports.ensureClusterViaApi = ensureClusterViaApi;
128
150
  async function waitForClusterHealthyViaApi(page, clusterUuid, timeoutMs = 1500000) {
129
151
  const orgId = getOrgId();
130
152
  const url = `${getConsoleBaseUrl()}/api/orgs/${orgId}/clusters/${clusterUuid}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.832",
3
+ "version": "0.0.833",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",