Skip to content

Commit e27069a

Browse files
committed
test(e2e): expand OCAPI permission set and double sandbox-create timeout
The previous attempt at catch-all OCAPI permissions used /** and /* top-level resource_ids and the shared sandbox failed to reach the started state within the 600s --wait timeout (both Linux and Windows shards). Replace with an explicit enumeration of the resources the e2e suite exercises (/sites, /sites/*, /job_execution_search, code/job defaults), and bump --timeout to 1200s plus the outer execa wrapper to 24 min so a slow sandbox start doesn't fail the run.
1 parent e9579ef commit e27069a

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

packages/b2c-cli/test/functional/e2e/hooks.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,27 @@ export const mochaHooks = {
4444
const realm = process.env.TEST_REALM!;
4545
const shortCode = process.env.SFCC_SHORTCODE!;
4646
const clientId = process.env.SFCC_CLIENT_ID!;
47-
48-
// Catch-all OCAPI permissions for the test sandbox so e2e suites exercising
49-
// arbitrary endpoints (sites, job_execution_search, …) don't depend on the
50-
// built-in DEFAULT_OCAPI_RESOURCES list staying in sync with new tests.
47+
const allMethods = ['get', 'post', 'put', 'patch', 'delete'];
48+
// OCAPI permissions for the test sandbox: enumerate every top-level
49+
// resource the suite touches, with attribute wildcards.
5150
const ocapiSettings = JSON.stringify([
5251
{
5352
client_id: clientId,
5453
resources: [
55-
{
56-
resource_id: '/**',
57-
methods: ['get', 'post', 'put', 'patch', 'delete'],
58-
read_attributes: '(**)',
59-
write_attributes: '(**)',
60-
},
61-
{
62-
resource_id: '/*',
63-
methods: ['get', 'post', 'put', 'patch', 'delete'],
64-
read_attributes: '(**)',
65-
write_attributes: '(**)',
66-
},
67-
],
54+
'/code_versions',
55+
'/code_versions/*',
56+
'/jobs/*/executions',
57+
'/jobs/*/executions/*',
58+
'/job_execution_search',
59+
'/sites',
60+
'/sites/*',
61+
'/sites/*/cartridges',
62+
].map((resourceId) => ({
63+
resource_id: resourceId,
64+
methods: allMethods,
65+
read_attributes: '(**)',
66+
write_attributes: '(**)',
67+
})),
6868
},
6969
]);
7070

@@ -79,6 +79,8 @@ export const mochaHooks = {
7979
'--ttl',
8080
'24',
8181
'--wait',
82+
'--timeout',
83+
'1200',
8284
'--set-permissions',
8385
'--ocapi-settings',
8486
ocapiSettings,

packages/b2c-cli/test/functional/e2e/test-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const TIMEOUTS = {
3333
/** Standard CLI operation (list, get, etc.) */
3434
DEFAULT: 30_000,
3535
/** ODS operations (create, start, stop with --wait) */
36-
ODS_OPERATION: 720_000, // 12 minutes
36+
ODS_OPERATION: 1_440_000, // 24 minutes
3737
/** Job execution with --wait */
3838
JOB_EXECUTION: 600_000, // 10 minutes
3939
/** WebDAV upload/download */

0 commit comments

Comments
 (0)