@open-mercato/scheduler 0.6.5-develop.4790.1.bffb4fd44b → 0.6.5-develop.4861.1.59f6de1891
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/scheduler/__integration__/TC-SCHED-CRUDFORM-001.spec.js +105 -0
- package/dist/modules/scheduler/__integration__/TC-SCHED-CRUDFORM-001.spec.js.map +7 -0
- package/package.json +5 -5
- package/src/modules/scheduler/__integration__/TC-SCHED-CRUDFORM-001.spec.ts +144 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[build:scheduler] found
|
|
1
|
+
[build:scheduler] found 51 entry points
|
|
2
2
|
[build:scheduler] built successfully
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { expect, test } from "@playwright/test";
|
|
2
|
+
import { apiRequest, getAuthToken } from "@open-mercato/core/helpers/integration/api";
|
|
3
|
+
import { readJsonSafe } from "@open-mercato/core/helpers/integration/generalFixtures";
|
|
4
|
+
import {
|
|
5
|
+
runCrudFormRoundTrip,
|
|
6
|
+
skipIfCrudFormExtensionTestsDisabled
|
|
7
|
+
} from "@open-mercato/core/helpers/integration/crudFormPersistence";
|
|
8
|
+
const SCHEDULER_JOBS_PATH = "/api/scheduler/jobs";
|
|
9
|
+
async function readScheduledJobById(request, token, id) {
|
|
10
|
+
const response = await apiRequest(
|
|
11
|
+
request,
|
|
12
|
+
"GET",
|
|
13
|
+
`${SCHEDULER_JOBS_PATH}?id=${encodeURIComponent(id)}&page=1&pageSize=100`,
|
|
14
|
+
{ token }
|
|
15
|
+
);
|
|
16
|
+
expect(response.status(), `read-back scheduler jobs failed: ${response.status()}`).toBe(200);
|
|
17
|
+
const body = await readJsonSafe(response);
|
|
18
|
+
return (body?.items ?? []).find((item) => item.id === id) ?? null;
|
|
19
|
+
}
|
|
20
|
+
test.describe("TC-SCHED-CRUDFORM-001: Scheduled Job CrudForm persists scope, target + payload JSON", () => {
|
|
21
|
+
test.beforeAll(() => {
|
|
22
|
+
skipIfCrudFormExtensionTestsDisabled();
|
|
23
|
+
});
|
|
24
|
+
test("round-trips scalars, scope, target + nested payload JSON on create and update", async ({ request }) => {
|
|
25
|
+
const token = await getAuthToken(request, "admin");
|
|
26
|
+
const stamp = Date.now();
|
|
27
|
+
const createPayload = {
|
|
28
|
+
source: "integration-test",
|
|
29
|
+
attempts: 3,
|
|
30
|
+
retries: { max: 5, backoff: "exponential" },
|
|
31
|
+
tags: ["alpha", "beta"]
|
|
32
|
+
};
|
|
33
|
+
const updatePayload = {
|
|
34
|
+
source: "integration-test-edited",
|
|
35
|
+
attempts: 1,
|
|
36
|
+
retries: { max: 0, backoff: "fixed" },
|
|
37
|
+
tags: ["gamma"]
|
|
38
|
+
};
|
|
39
|
+
await runCrudFormRoundTrip({
|
|
40
|
+
request,
|
|
41
|
+
token,
|
|
42
|
+
collectionPath: SCHEDULER_JOBS_PATH,
|
|
43
|
+
readById: (id) => readScheduledJobById(request, token, id),
|
|
44
|
+
create: {
|
|
45
|
+
payload: {
|
|
46
|
+
name: `QA CRUDFORM Scheduled Job ${stamp}`,
|
|
47
|
+
description: "Original scheduled job description",
|
|
48
|
+
scopeType: "organization",
|
|
49
|
+
scheduleType: "interval",
|
|
50
|
+
scheduleValue: "15m",
|
|
51
|
+
timezone: "UTC",
|
|
52
|
+
targetType: "queue",
|
|
53
|
+
targetQueue: "scheduler-execution",
|
|
54
|
+
targetPayload: createPayload,
|
|
55
|
+
isEnabled: true,
|
|
56
|
+
sourceType: "user"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
expectAfterCreate: {
|
|
60
|
+
scalars: {
|
|
61
|
+
name: `QA CRUDFORM Scheduled Job ${stamp}`,
|
|
62
|
+
description: "Original scheduled job description",
|
|
63
|
+
scopeType: "organization",
|
|
64
|
+
scheduleType: "interval",
|
|
65
|
+
scheduleValue: "15m",
|
|
66
|
+
timezone: "UTC",
|
|
67
|
+
targetType: "queue",
|
|
68
|
+
targetQueue: "scheduler-execution",
|
|
69
|
+
targetCommand: null,
|
|
70
|
+
targetPayload: createPayload,
|
|
71
|
+
isEnabled: true,
|
|
72
|
+
sourceType: "user"
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
update: {
|
|
76
|
+
payload: (id) => ({
|
|
77
|
+
id,
|
|
78
|
+
name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,
|
|
79
|
+
description: "Updated scheduled job description",
|
|
80
|
+
scheduleType: "cron",
|
|
81
|
+
scheduleValue: "0 0 * * *",
|
|
82
|
+
timezone: "Europe/Warsaw",
|
|
83
|
+
targetPayload: updatePayload,
|
|
84
|
+
isEnabled: false
|
|
85
|
+
})
|
|
86
|
+
},
|
|
87
|
+
expectAfterUpdate: {
|
|
88
|
+
scalars: {
|
|
89
|
+
name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,
|
|
90
|
+
description: "Updated scheduled job description",
|
|
91
|
+
scopeType: "organization",
|
|
92
|
+
scheduleType: "cron",
|
|
93
|
+
scheduleValue: "0 0 * * *",
|
|
94
|
+
timezone: "Europe/Warsaw",
|
|
95
|
+
targetType: "queue",
|
|
96
|
+
targetQueue: "scheduler-execution",
|
|
97
|
+
targetCommand: null,
|
|
98
|
+
targetPayload: updatePayload,
|
|
99
|
+
isEnabled: false
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=TC-SCHED-CRUDFORM-001.spec.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/modules/scheduler/__integration__/TC-SCHED-CRUDFORM-001.spec.ts"],
|
|
4
|
+
"sourcesContent": ["import { expect, test, type APIRequestContext } from '@playwright/test';\nimport { apiRequest, getAuthToken } from '@open-mercato/core/helpers/integration/api';\nimport { readJsonSafe } from '@open-mercato/core/helpers/integration/generalFixtures';\nimport {\n runCrudFormRoundTrip,\n skipIfCrudFormExtensionTestsDisabled,\n type CrudRecord,\n} from '@open-mercato/core/helpers/integration/crudFormPersistence';\n\n/**\n * TC-SCHED-CRUDFORM-001: Scheduled Job CrudForm persists scope, target + payload JSON (#2466).\n *\n * The scheduler's scheduled-job is the Tier-B \"JSON-bearing scalar\" surface: scope\n * (scopeType, server-derived org/tenant), schedule (scheduleType/scheduleValue/timezone),\n * target (targetType/targetQueue), and a nested `targetPayload` JSON object. Proves create +\n * update round-trip every value.\n *\n * Verified contract (differs from the makeCrud-default reference specs):\n * - The list GET filters by `?id=` (single uuid), not the `?ids=` other sweep modules use; the\n * explicit `readById` documents that contract and mirrors the sibling specs (the shared\n * harness default reads back via `?id=` too).\n * - Read-back is camelCase: the list `transformItem` maps every column to camelCase\n * (`scopeType`, `scheduleType`, `targetPayload`, `isEnabled`, ...), so the scalar\n * expectations use camelCase keys (not the snake_case of resources/staff).\n * - The scheduled-job declares no custom entity (no `ce.ts`), so there are no `cf_*` fields \u2014\n * the surface is scalars + nested JSON only.\n * - Scope is derived server-side from the caller's auth context and is immutable on update:\n * `scopeType: 'organization'` fills org+tenant from the admin token and survives the edit.\n * - Update is a partial PUT: omitted target fields are retained, so the update changes the\n * payload JSON while proving `targetType`/`targetQueue` survive untouched.\n * - Harness cleanup deletes via `?id=`; the scheduler delete resolves the id from the query\n * string, so the default `finally` cleanup removes the fixture.\n *\n * Self-contained: the job needs no pre-created fixtures (queue target + inline JSON), and the\n * harness deletes it in `finally`.\n *\n * Gated by `OM_INTEGRATION_CRUDFORM_EXTENSION_TESTS_DISABLED` (default off \u2192 runs).\n */\nconst SCHEDULER_JOBS_PATH = '/api/scheduler/jobs';\n\nasync function readScheduledJobById(\n request: APIRequestContext,\n token: string,\n id: string,\n): Promise<CrudRecord | null> {\n const response = await apiRequest(\n request,\n 'GET',\n `${SCHEDULER_JOBS_PATH}?id=${encodeURIComponent(id)}&page=1&pageSize=100`,\n { token },\n );\n expect(response.status(), `read-back scheduler jobs failed: ${response.status()}`).toBe(200);\n const body = await readJsonSafe<{ items?: CrudRecord[] }>(response);\n return (body?.items ?? []).find((item) => item.id === id) ?? null;\n}\n\ntest.describe('TC-SCHED-CRUDFORM-001: Scheduled Job CrudForm persists scope, target + payload JSON', () => {\n test.beforeAll(() => {\n skipIfCrudFormExtensionTestsDisabled();\n });\n\n test('round-trips scalars, scope, target + nested payload JSON on create and update', async ({ request }) => {\n const token = await getAuthToken(request, 'admin');\n const stamp = Date.now();\n\n const createPayload = {\n source: 'integration-test',\n attempts: 3,\n retries: { max: 5, backoff: 'exponential' },\n tags: ['alpha', 'beta'],\n };\n const updatePayload = {\n source: 'integration-test-edited',\n attempts: 1,\n retries: { max: 0, backoff: 'fixed' },\n tags: ['gamma'],\n };\n\n await runCrudFormRoundTrip({\n request,\n token,\n collectionPath: SCHEDULER_JOBS_PATH,\n readById: (id) => readScheduledJobById(request, token, id),\n create: {\n payload: {\n name: `QA CRUDFORM Scheduled Job ${stamp}`,\n description: 'Original scheduled job description',\n scopeType: 'organization',\n scheduleType: 'interval',\n scheduleValue: '15m',\n timezone: 'UTC',\n targetType: 'queue',\n targetQueue: 'scheduler-execution',\n targetPayload: createPayload,\n isEnabled: true,\n sourceType: 'user',\n },\n },\n expectAfterCreate: {\n scalars: {\n name: `QA CRUDFORM Scheduled Job ${stamp}`,\n description: 'Original scheduled job description',\n scopeType: 'organization',\n scheduleType: 'interval',\n scheduleValue: '15m',\n timezone: 'UTC',\n targetType: 'queue',\n targetQueue: 'scheduler-execution',\n targetCommand: null,\n targetPayload: createPayload,\n isEnabled: true,\n sourceType: 'user',\n },\n },\n update: {\n payload: (id) => ({\n id,\n name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,\n description: 'Updated scheduled job description',\n scheduleType: 'cron',\n scheduleValue: '0 0 * * *',\n timezone: 'Europe/Warsaw',\n targetPayload: updatePayload,\n isEnabled: false,\n }),\n },\n expectAfterUpdate: {\n scalars: {\n name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,\n description: 'Updated scheduled job description',\n scopeType: 'organization',\n scheduleType: 'cron',\n scheduleValue: '0 0 * * *',\n timezone: 'Europe/Warsaw',\n targetType: 'queue',\n targetQueue: 'scheduler-execution',\n targetCommand: null,\n targetPayload: updatePayload,\n isEnabled: false,\n },\n },\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,QAAQ,YAAoC;AACrD,SAAS,YAAY,oBAAoB;AACzC,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AA+BP,MAAM,sBAAsB;AAE5B,eAAe,qBACb,SACA,OACA,IAC4B;AAC5B,QAAM,WAAW,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA,GAAG,mBAAmB,OAAO,mBAAmB,EAAE,CAAC;AAAA,IACnD,EAAE,MAAM;AAAA,EACV;AACA,SAAO,SAAS,OAAO,GAAG,oCAAoC,SAAS,OAAO,CAAC,EAAE,EAAE,KAAK,GAAG;AAC3F,QAAM,OAAO,MAAM,aAAuC,QAAQ;AAClE,UAAQ,MAAM,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,KAAK,OAAO,EAAE,KAAK;AAC/D;AAEA,KAAK,SAAS,uFAAuF,MAAM;AACzG,OAAK,UAAU,MAAM;AACnB,yCAAqC;AAAA,EACvC,CAAC;AAED,OAAK,iFAAiF,OAAO,EAAE,QAAQ,MAAM;AAC3G,UAAM,QAAQ,MAAM,aAAa,SAAS,OAAO;AACjD,UAAM,QAAQ,KAAK,IAAI;AAEvB,UAAM,gBAAgB;AAAA,MACpB,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS,EAAE,KAAK,GAAG,SAAS,cAAc;AAAA,MAC1C,MAAM,CAAC,SAAS,MAAM;AAAA,IACxB;AACA,UAAM,gBAAgB;AAAA,MACpB,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,SAAS,EAAE,KAAK,GAAG,SAAS,QAAQ;AAAA,MACpC,MAAM,CAAC,OAAO;AAAA,IAChB;AAEA,UAAM,qBAAqB;AAAA,MACzB;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,UAAU,CAAC,OAAO,qBAAqB,SAAS,OAAO,EAAE;AAAA,MACzD,QAAQ;AAAA,QACN,SAAS;AAAA,UACP,MAAM,6BAA6B,KAAK;AAAA,UACxC,aAAa;AAAA,UACb,WAAW;AAAA,UACX,cAAc;AAAA,UACd,eAAe;AAAA,UACf,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,eAAe;AAAA,UACf,WAAW;AAAA,UACX,YAAY;AAAA,QACd;AAAA,MACF;AAAA,MACA,mBAAmB;AAAA,QACjB,SAAS;AAAA,UACP,MAAM,6BAA6B,KAAK;AAAA,UACxC,aAAa;AAAA,UACb,WAAW;AAAA,UACX,cAAc;AAAA,UACd,eAAe;AAAA,UACf,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,eAAe;AAAA,UACf,eAAe;AAAA,UACf,WAAW;AAAA,UACX,YAAY;AAAA,QACd;AAAA,MACF;AAAA,MACA,QAAQ;AAAA,QACN,SAAS,CAAC,QAAQ;AAAA,UAChB;AAAA,UACA,MAAM,6BAA6B,KAAK;AAAA,UACxC,aAAa;AAAA,UACb,cAAc;AAAA,UACd,eAAe;AAAA,UACf,UAAU;AAAA,UACV,eAAe;AAAA,UACf,WAAW;AAAA,QACb;AAAA,MACF;AAAA,MACA,mBAAmB;AAAA,QACjB,SAAS;AAAA,UACP,MAAM,6BAA6B,KAAK;AAAA,UACxC,aAAa;AAAA,UACb,WAAW;AAAA,UACX,cAAc;AAAA,UACd,eAAe;AAAA,UACf,UAAU;AAAA,UACV,YAAY;AAAA,UACZ,aAAa;AAAA,UACb,eAAe;AAAA,UACf,eAAe;AAAA,UACf,WAAW;AAAA,QACb;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-mercato/scheduler",
|
|
3
|
-
"version": "0.6.5-develop.
|
|
3
|
+
"version": "0.6.5-develop.4861.1.59f6de1891",
|
|
4
4
|
"description": "Database-managed scheduled jobs with admin UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"./*/*/*/*/*/*.json": "./src/*/*/*/*/*/*.json"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@open-mercato/events": "0.6.5-develop.
|
|
62
|
-
"@open-mercato/queue": "0.6.5-develop.
|
|
61
|
+
"@open-mercato/events": "0.6.5-develop.4861.1.59f6de1891",
|
|
62
|
+
"@open-mercato/queue": "0.6.5-develop.4861.1.59f6de1891",
|
|
63
63
|
"cron-parser": "^5.5.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@mikro-orm/core": "^7.0.14",
|
|
67
|
-
"@open-mercato/shared": "0.6.5-develop.
|
|
67
|
+
"@open-mercato/shared": "0.6.5-develop.4861.1.59f6de1891",
|
|
68
68
|
"bullmq": "^5.0.0",
|
|
69
69
|
"ioredis": "^5.0.0",
|
|
70
70
|
"zod": ">=3.23.0"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@open-mercato/shared": "0.6.5-develop.
|
|
81
|
+
"@open-mercato/shared": "0.6.5-develop.4861.1.59f6de1891",
|
|
82
82
|
"@types/jest": "^30.0.0",
|
|
83
83
|
"@types/node": "^25.9.1",
|
|
84
84
|
"jest": "^30.4.2",
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { expect, test, type APIRequestContext } from '@playwright/test';
|
|
2
|
+
import { apiRequest, getAuthToken } from '@open-mercato/core/helpers/integration/api';
|
|
3
|
+
import { readJsonSafe } from '@open-mercato/core/helpers/integration/generalFixtures';
|
|
4
|
+
import {
|
|
5
|
+
runCrudFormRoundTrip,
|
|
6
|
+
skipIfCrudFormExtensionTestsDisabled,
|
|
7
|
+
type CrudRecord,
|
|
8
|
+
} from '@open-mercato/core/helpers/integration/crudFormPersistence';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* TC-SCHED-CRUDFORM-001: Scheduled Job CrudForm persists scope, target + payload JSON (#2466).
|
|
12
|
+
*
|
|
13
|
+
* The scheduler's scheduled-job is the Tier-B "JSON-bearing scalar" surface: scope
|
|
14
|
+
* (scopeType, server-derived org/tenant), schedule (scheduleType/scheduleValue/timezone),
|
|
15
|
+
* target (targetType/targetQueue), and a nested `targetPayload` JSON object. Proves create +
|
|
16
|
+
* update round-trip every value.
|
|
17
|
+
*
|
|
18
|
+
* Verified contract (differs from the makeCrud-default reference specs):
|
|
19
|
+
* - The list GET filters by `?id=` (single uuid), not the `?ids=` other sweep modules use; the
|
|
20
|
+
* explicit `readById` documents that contract and mirrors the sibling specs (the shared
|
|
21
|
+
* harness default reads back via `?id=` too).
|
|
22
|
+
* - Read-back is camelCase: the list `transformItem` maps every column to camelCase
|
|
23
|
+
* (`scopeType`, `scheduleType`, `targetPayload`, `isEnabled`, ...), so the scalar
|
|
24
|
+
* expectations use camelCase keys (not the snake_case of resources/staff).
|
|
25
|
+
* - The scheduled-job declares no custom entity (no `ce.ts`), so there are no `cf_*` fields —
|
|
26
|
+
* the surface is scalars + nested JSON only.
|
|
27
|
+
* - Scope is derived server-side from the caller's auth context and is immutable on update:
|
|
28
|
+
* `scopeType: 'organization'` fills org+tenant from the admin token and survives the edit.
|
|
29
|
+
* - Update is a partial PUT: omitted target fields are retained, so the update changes the
|
|
30
|
+
* payload JSON while proving `targetType`/`targetQueue` survive untouched.
|
|
31
|
+
* - Harness cleanup deletes via `?id=`; the scheduler delete resolves the id from the query
|
|
32
|
+
* string, so the default `finally` cleanup removes the fixture.
|
|
33
|
+
*
|
|
34
|
+
* Self-contained: the job needs no pre-created fixtures (queue target + inline JSON), and the
|
|
35
|
+
* harness deletes it in `finally`.
|
|
36
|
+
*
|
|
37
|
+
* Gated by `OM_INTEGRATION_CRUDFORM_EXTENSION_TESTS_DISABLED` (default off → runs).
|
|
38
|
+
*/
|
|
39
|
+
const SCHEDULER_JOBS_PATH = '/api/scheduler/jobs';
|
|
40
|
+
|
|
41
|
+
async function readScheduledJobById(
|
|
42
|
+
request: APIRequestContext,
|
|
43
|
+
token: string,
|
|
44
|
+
id: string,
|
|
45
|
+
): Promise<CrudRecord | null> {
|
|
46
|
+
const response = await apiRequest(
|
|
47
|
+
request,
|
|
48
|
+
'GET',
|
|
49
|
+
`${SCHEDULER_JOBS_PATH}?id=${encodeURIComponent(id)}&page=1&pageSize=100`,
|
|
50
|
+
{ token },
|
|
51
|
+
);
|
|
52
|
+
expect(response.status(), `read-back scheduler jobs failed: ${response.status()}`).toBe(200);
|
|
53
|
+
const body = await readJsonSafe<{ items?: CrudRecord[] }>(response);
|
|
54
|
+
return (body?.items ?? []).find((item) => item.id === id) ?? null;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
test.describe('TC-SCHED-CRUDFORM-001: Scheduled Job CrudForm persists scope, target + payload JSON', () => {
|
|
58
|
+
test.beforeAll(() => {
|
|
59
|
+
skipIfCrudFormExtensionTestsDisabled();
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('round-trips scalars, scope, target + nested payload JSON on create and update', async ({ request }) => {
|
|
63
|
+
const token = await getAuthToken(request, 'admin');
|
|
64
|
+
const stamp = Date.now();
|
|
65
|
+
|
|
66
|
+
const createPayload = {
|
|
67
|
+
source: 'integration-test',
|
|
68
|
+
attempts: 3,
|
|
69
|
+
retries: { max: 5, backoff: 'exponential' },
|
|
70
|
+
tags: ['alpha', 'beta'],
|
|
71
|
+
};
|
|
72
|
+
const updatePayload = {
|
|
73
|
+
source: 'integration-test-edited',
|
|
74
|
+
attempts: 1,
|
|
75
|
+
retries: { max: 0, backoff: 'fixed' },
|
|
76
|
+
tags: ['gamma'],
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
await runCrudFormRoundTrip({
|
|
80
|
+
request,
|
|
81
|
+
token,
|
|
82
|
+
collectionPath: SCHEDULER_JOBS_PATH,
|
|
83
|
+
readById: (id) => readScheduledJobById(request, token, id),
|
|
84
|
+
create: {
|
|
85
|
+
payload: {
|
|
86
|
+
name: `QA CRUDFORM Scheduled Job ${stamp}`,
|
|
87
|
+
description: 'Original scheduled job description',
|
|
88
|
+
scopeType: 'organization',
|
|
89
|
+
scheduleType: 'interval',
|
|
90
|
+
scheduleValue: '15m',
|
|
91
|
+
timezone: 'UTC',
|
|
92
|
+
targetType: 'queue',
|
|
93
|
+
targetQueue: 'scheduler-execution',
|
|
94
|
+
targetPayload: createPayload,
|
|
95
|
+
isEnabled: true,
|
|
96
|
+
sourceType: 'user',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
expectAfterCreate: {
|
|
100
|
+
scalars: {
|
|
101
|
+
name: `QA CRUDFORM Scheduled Job ${stamp}`,
|
|
102
|
+
description: 'Original scheduled job description',
|
|
103
|
+
scopeType: 'organization',
|
|
104
|
+
scheduleType: 'interval',
|
|
105
|
+
scheduleValue: '15m',
|
|
106
|
+
timezone: 'UTC',
|
|
107
|
+
targetType: 'queue',
|
|
108
|
+
targetQueue: 'scheduler-execution',
|
|
109
|
+
targetCommand: null,
|
|
110
|
+
targetPayload: createPayload,
|
|
111
|
+
isEnabled: true,
|
|
112
|
+
sourceType: 'user',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
update: {
|
|
116
|
+
payload: (id) => ({
|
|
117
|
+
id,
|
|
118
|
+
name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,
|
|
119
|
+
description: 'Updated scheduled job description',
|
|
120
|
+
scheduleType: 'cron',
|
|
121
|
+
scheduleValue: '0 0 * * *',
|
|
122
|
+
timezone: 'Europe/Warsaw',
|
|
123
|
+
targetPayload: updatePayload,
|
|
124
|
+
isEnabled: false,
|
|
125
|
+
}),
|
|
126
|
+
},
|
|
127
|
+
expectAfterUpdate: {
|
|
128
|
+
scalars: {
|
|
129
|
+
name: `QA CRUDFORM Scheduled Job ${stamp} EDITED`,
|
|
130
|
+
description: 'Updated scheduled job description',
|
|
131
|
+
scopeType: 'organization',
|
|
132
|
+
scheduleType: 'cron',
|
|
133
|
+
scheduleValue: '0 0 * * *',
|
|
134
|
+
timezone: 'Europe/Warsaw',
|
|
135
|
+
targetType: 'queue',
|
|
136
|
+
targetQueue: 'scheduler-execution',
|
|
137
|
+
targetCommand: null,
|
|
138
|
+
targetPayload: updatePayload,
|
|
139
|
+
isEnabled: false,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
});
|