Skip to content

Commit db467ff

Browse files
committed
fix(bulk-operations): use dynamic stack API key from testContext
Fix 401 Unauthorized errors in bulk operation tests by using the dynamically created stack's API key from testSetup.testContext instead of process.env.API_KEY. The helper functions (doBulkOperation, doBulkOperationWithManagementToken, makeManagementToken) were using process.env.API_KEY which wasn't set at the time of execution, causing authentication failures on both dev9 and dev11 environments. Changes: - Updated helper functions to use testSetup.testContext.stackApiKey - Ensures correct API key is used for all bulk operations - Fixes job status check failures and other bulk operation 401 errors - Updated .talismanrc checksum for bulkOperation-test.js
1 parent c1ac4c8 commit db467ff

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fileignoreconfig:
9494
- filename: test/sanity-check/api/contentType-test.js
9595
checksum: 4d5178998f9f3c27550c5bd21540e254e08f79616e8615e7256ba2175cb4c8e1
9696
- filename: test/sanity-check/api/bulkOperation-test.js
97-
checksum: 9b67a8691cf7aeea448dacf2dbfb131d3d00b27be09dfa18c30684103fae2ba7
97+
checksum: 61a2f6f77f429754edf8693cd56879f6d1830173a12a3592fbdb76e73af5be47
9898
- filename: test/sanity-check/api/entry-test.js
9999
checksum: 9dc16b404a98ff9fa2c164fad0182b291b9c338dd58558dc5ef8dd75cf18bc1f
100100
- filename: test/sanity-check/api/entryVariants-test.js

test/sanity-check/api/bulkOperation-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,16 @@ describe('BulkOperation api test', () => {
541541
})
542542

543543
function doBulkOperation (uid = null) {
544-
// @ts-ignore-next-line secret-detection
545-
return client.stack({ api_key: process.env.API_KEY }).bulkOperation()
544+
const ctx = testSetup.testContext
545+
return client.stack({ api_key: ctx.stackApiKey }).bulkOperation()
546546
}
547547

548548
function doBulkOperationWithManagementToken (tokenUidDev) {
549-
// @ts-ignore-next-line secret-detection
550-
return clientWithManagementToken.stack({ api_key: process.env.API_KEY, management_token: tokenUidDev }).bulkOperation()
549+
const ctx = testSetup.testContext
550+
return clientWithManagementToken.stack({ api_key: ctx.stackApiKey, management_token: tokenUidDev }).bulkOperation()
551551
}
552552

553553
function makeManagementToken (uid = null) {
554-
// @ts-ignore-next-line secret-detection
555-
return client.stack({ api_key: process.env.API_KEY }).managementToken(uid)
554+
const ctx = testSetup.testContext
555+
return client.stack({ api_key: ctx.stackApiKey }).managementToken(uid)
556556
}

0 commit comments

Comments
 (0)