Skip to content

Commit e0d0afc

Browse files
test(serenity): bump PE/UM clients to the #1746 round-trip mock, run round-trip unconditionally
adobe/spacecat-shared#1746 merged and released the round-trip mock: @adobe/spacecat-shared-project-engine-client 1.3.1 -> 1.3.2 and @adobe/spacecat-shared-user-manager-client 1.3.0 -> 1.3.1. The harness derives the mock image tag from the installed client version, so the serenity IT now boots the published round-trip mocks. The created+published market round-trip is now the pinned contract, so the read-back / prompt-lifecycle block drops its capability probe and runs unconditionally — a regression in the mock or transport fails loudly rather than silently skipping. Full serenity IT: 26 passing (was 22 + 4 pending) against the published 1.3.2 / 1.3.1 images. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 70973f7 commit e0d0afc

3 files changed

Lines changed: 27 additions & 60 deletions

File tree

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@
9393
"@adobe/spacecat-shared-http-utils": "1.31.0",
9494
"@adobe/spacecat-shared-ims-client": "1.12.7",
9595
"@adobe/spacecat-shared-launchdarkly-client": "1.3.0",
96-
"@adobe/spacecat-shared-project-engine-client": "1.3.1",
96+
"@adobe/spacecat-shared-project-engine-client": "1.3.2",
9797
"@adobe/spacecat-shared-rum-api-client": "2.44.0",
9898
"@adobe/spacecat-shared-scrape-client": "2.6.3",
9999
"@adobe/spacecat-shared-slack-client": "1.6.7",
100100
"@adobe/spacecat-shared-tier-client": "1.5.1",
101101
"@adobe/spacecat-shared-tokowaka-client": "1.20.0",
102-
"@adobe/spacecat-shared-user-manager-client": "1.3.0",
102+
"@adobe/spacecat-shared-user-manager-client": "1.3.1",
103103
"@adobe/spacecat-shared-utils": "1.123.0",
104104
"@adobe/spacecat-shared-vault-secrets": "1.3.5",
105105
"@aws-sdk/client-cloudfront": "3.1045.0",

test/it/shared/tests/serenity.js

Lines changed: 17 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,12 @@ import { ORG_1_ID, BRAND_1_ID } from '../seed-ids.js';
4646
* decommissions, `DELETE markets` removes a slice.
4747
* - The sub-workspace ROUND-TRIP (read-back): a created+published market lists in
4848
* `GET markets` as `live`, resolves via `GET markets/:slice`, and a prompt
49-
* attaches to that slice and lists back (with text dedup). This needs the PE
50-
* mock round-trip fix (adobe/spacecat-shared#1745, PR #1746): the project
51-
* read-view must echo the ISO language code so the transport's `langOf` can
52-
* derive the slice, and `publish` must flip `publish_status` -> `live`. The
53-
* published image <= 1.3.1 does NOT, so that block is guarded by a one-shot
54-
* capability probe — it SKIPS against the old image (suite stays green) and
55-
* auto-activates once the client (hence the pinned mock tag) is bumped to the
56-
* released round-trip mock. Verified to PASS against a local build of #1746.
49+
* attaches to that slice and lists back (with text dedup). This relies on the PE
50+
* mock round-trip fix (adobe/spacecat-shared#1745, PR #1746, shipped in PE
51+
* >= 1.3.2 / UM >= 1.3.1): the project read-view echoes the ISO language code so
52+
* the transport's `langOf` derives the slice, and `publish` flips
53+
* `publish_status` -> `live`. Pinned by the bumped client deps, so it runs
54+
* unconditionally.
5755
*/
5856
export default function serenityTests(getHttpClient, resetData, resetMocks = async () => {}) {
5957
// Seed the baseline org/brand rows the catalog + brand-resolution tests read.
@@ -250,7 +248,7 @@ export default function serenityTests(getHttpClient, resetData, resetMocks = asy
250248
// OPERATIONS return their real 2xx. The full round-trip (a created market then
251249
// appearing in GET markets / GET markets/:slice, and a prompt created against
252250
// that slice) is asserted in the separate "sub-workspace round-trip" describe
253-
// below, which is capability-gated on the PE mock round-trip fix (#1745/#1746).
251+
// below, enabled by the PE mock round-trip fix (#1745/#1746, PE >= 1.3.2).
254252
beforeEach(async () => {
255253
await resetData();
256254
await resetMocks();
@@ -303,53 +301,22 @@ export default function serenityTests(getHttpClient, resetData, resetMocks = asy
303301
});
304302
});
305303

306-
describe('Serenity API — sub-workspace round-trip (live mock, requires #1745 fix)', () => {
307-
// The read-back assertions below require the PE mock to ROUND-TRIP a created+
308-
// published market (adobe/spacecat-shared#1745, fixed by PR #1746): its project
309-
// read-view must echo the ISO language code (so the transport's `langOf` derives
310-
// the slice's languageCode) and `publish` must flip `publish_status` -> `live`.
311-
// The currently-published mock image (<= 1.3.1) does NOT, so a created market is
312-
// dropped from `GET markets` and never resolves. Rather than fail against the old
313-
// image, a one-shot capability probe in `before()` skips these when the booted
314-
// mock cannot round-trip — the suite stays green on the published image and these
315-
// auto-activate the moment the client (hence the pinned mock image) is bumped to
316-
// the released round-trip mock. Verified to PASS against a local build of the
317-
// #1746 (feat/1745) mock.
304+
describe('Serenity API — sub-workspace round-trip (live mock)', () => {
305+
// Read-back: a created+published market lists in `GET markets` as `live`,
306+
// resolves via `GET markets/:slice`, and a prompt attaches to that slice and
307+
// lists back (with text dedup). This is the contract the PE mock round-trip fix
308+
// guarantees (adobe/spacecat-shared#1745, PR #1746): the project read-view echoes
309+
// the ISO language code (so the transport's `langOf` derives the slice) and
310+
// `publish` flips `publish_status` -> `live`. Pinned by the bumped client deps
311+
// (PE >= 1.3.2 / UM >= 1.3.1, which select the round-trip mock image), so these
312+
// run unconditionally — a regression in the mock or transport fails loudly here.
318313
const base = `/v2/orgs/${ORG_1_ID}/brands/${BRAND_1_ID}/serenity`;
319314
const US_GEO = 2840; // US resolves to Google geoTargetId 2840.
320315
const createUsMarket = () => getHttpClient().admin.post(`${base}/markets`, {
321316
market: 'US', languageCode: 'en', brandDomain: 'example.com', brandNames: ['Test Brand'],
322317
});
323318

324-
let roundTripSupported = false;
325-
before(async () => {
326-
await resetData();
327-
await resetMocks();
328-
// Probe the booted mock: create+publish a market, then see if it lists back.
329-
const created = await createUsMarket();
330-
if (created.status === 201) {
331-
const list = await getHttpClient().admin.get(`${base}/markets`);
332-
roundTripSupported = Array.isArray(list.body?.items)
333-
&& list.body.items.some((m) => m.geoTargetId === US_GEO && m.languageCode === 'en');
334-
}
335-
if (!roundTripSupported) {
336-
// eslint-disable-next-line no-console
337-
console.warn(
338-
'[serenity IT] booted PE mock does not round-trip a created market — '
339-
+ 'skipping read-back assertions (requires the adobe/spacecat-shared#1745 fix, PR #1746). '
340-
+ 'Bump @adobe/spacecat-shared-project-engine-client to the released round-trip mock to enable.',
341-
);
342-
}
343-
// Leave a clean store whether or not the probe found support (the skip path
344-
// below does NOT reset, so clean up the probe's mutation here).
345-
await resetData();
346-
await resetMocks();
347-
});
348-
349-
beforeEach(async function gate() {
350-
if (!roundTripSupported) {
351-
this.skip();
352-
}
319+
beforeEach(async () => {
353320
await resetData();
354321
await resetMocks();
355322
});

0 commit comments

Comments
 (0)