diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5333cb516..524b3c68a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,10 +11,11 @@ defaults: shell: bash env: CXX: 'g++-4.8' - PAM_SUBSCRIBE_KEY: ${{ secrets.TESTS_PAM_SUBSCRIBE_KEY }} - PAM_PUBLISH_KEY: ${{ secrets.TESTS_PAM_PUBLISH_KEY }} - SUBSCRIBE_KEY: ${{ secrets.TESTS_PUBLISH_KEY }} - PUBLISH_KEY: ${{ secrets.TESTS_SUBSCRIBE_KEY }} + PAM_SUBSCRIBE_KEY: ${{ secrets.SDK_PAM_SUB_KEY }} + PAM_PUBLISH_KEY: ${{ secrets.SDK_PAM_PUB_KEY }} + PAM_SECRET_KEY: ${{ secrets.SDK_PAM_SEC_KEY }} + SUBSCRIBE_KEY: ${{ secrets.SDK_SUB_KEY }} + PUBLISH_KEY: ${{ secrets.SDK_PUB_KEY }} jobs: tests: diff --git a/test/contract/shared/keysets.ts b/test/contract/shared/keysets.ts index bcdbd5840..fe38c4cff 100644 --- a/test/contract/shared/keysets.ts +++ b/test/contract/shared/keysets.ts @@ -1,9 +1,9 @@ import { Keyset } from './pubnub'; export class AccessManagerKeyset implements Keyset { - publishKey = process.env.PUBLISH_KEY_ACCESS || 'pub-key'; - subscribeKey = process.env.SUBSCRIBE_KEY_ACCESS || 'sub-key'; - secretKey = process.env.SECRET_KEY_ACCESS || 'secret-key'; + subscribeKey = process.env.PAM_SUBSCRIBE_KEY || 'sub-key'; + secretKey = process.env.PAM_SECRET_KEY || 'secret-key'; + publishKey = process.env.PAM_PUBLISH_KEY || 'pub-key'; } export class DemoKeyset implements Keyset { diff --git a/test/dist/objectsv2.test.ts b/test/dist/objectsv2.test.ts index 2189cd920..dec3002af 100644 --- a/test/dist/objectsv2.test.ts +++ b/test/dist/objectsv2.test.ts @@ -12,9 +12,6 @@ chai.use(chaiAsPromised); chai.use(chaiNock); describe('Objects V2 system tests', () => { - const SUBSCRIBE_KEY = 'sub-c-d86a1698-889e-11ea-b883-d2d532c9a1bf'; - const PUBLISH_KEY = 'pub-c-5397272a-7664-4b57-bc91-944977fb3f25'; - const TEST_PREFIX = 'objectsV2tests'; const UUID = `${TEST_PREFIX}-main`; const UUID_1 = `${TEST_PREFIX}-uuid-1`; @@ -32,8 +29,8 @@ describe('Objects V2 system tests', () => { before(() => { pubnub = new PubNub({ - subscribeKey: SUBSCRIBE_KEY, - publishKey: PUBLISH_KEY, + subscribeKey: process.env.SUBSCRIBE_KEY || 'demo', + publishKey: process.env.PUBLISH_KEY || 'demo', uuid: UUID, // logVerbosity: true }); diff --git a/test/feature/file_upload.node.test.ts b/test/feature/file_upload.node.test.ts index 500a480be..85cdeb29f 100644 --- a/test/feature/file_upload.node.test.ts +++ b/test/feature/file_upload.node.test.ts @@ -12,9 +12,6 @@ chai.use(chaiAsPromised); chai.use(chaiNock); describe('File Upload API v1 tests', () => { - const SUBSCRIBE_KEY = 'demo'; - const PUBLISH_KEY = 'demo'; - const ORIGIN = undefined; const TEST_PREFIX = 'javascript-fileUploadApiV1-tests'; @@ -29,8 +26,8 @@ describe('File Upload API v1 tests', () => { describe('with encryption', () => { pubnub = new PubNub({ - subscribeKey: SUBSCRIBE_KEY, - publishKey: PUBLISH_KEY, + subscribeKey: process.env.SUBSCRIBE_KEY || 'demo', + publishKey: process.env.PUBLISH_KEY || 'demo', uuid: UUID, origin: ORIGIN, cipherKey: 'abcdef', @@ -42,8 +39,8 @@ describe('File Upload API v1 tests', () => { describe('without encryption', () => { pubnub = new PubNub({ - subscribeKey: SUBSCRIBE_KEY, - publishKey: PUBLISH_KEY, + subscribeKey: process.env.SUBSCRIBE_KEY || 'demo', + publishKey: process.env.PUBLISH_KEY || 'demo', origin: ORIGIN, uuid: UUID, }); diff --git a/test/feature/file_upload.web.test.js b/test/feature/file_upload.web.test.js index daa68d336..4802981a3 100644 --- a/test/feature/file_upload.web.test.js +++ b/test/feature/file_upload.web.test.js @@ -13,9 +13,6 @@ function urlToFile(url, filename, mimeType) { } describe('test', () => { - const SUBSCRIBE_KEY = 'demo-36'; - const PUBLISH_KEY = 'demo-36'; - const TEST_PREFIX = 'javascript-fileUploadApiV1-tests'; const UUID = `${TEST_PREFIX}-main`; const UUID_1 = `${TEST_PREFIX}-uuid-1`; @@ -24,7 +21,7 @@ describe('test', () => { const FILE_1 = `${TEST_PREFIX}-file-1`; - let pubnub ; + let pubnub; after(() => { pubnub.unsubscribeAll(); @@ -33,8 +30,8 @@ describe('test', () => { describe('with encryption', () => { pubnub = new PubNub({ - subscribeKey: SUBSCRIBE_KEY, - publishKey: PUBLISH_KEY, + subscribeKey: process.env.SUBSCRIBE_KEY || 'demo', + publishKey: process.env.PUBLISH_KEY || 'demo', uuid: UUID, cipherKey: 'abcdef', }); @@ -44,8 +41,8 @@ describe('test', () => { describe('without encryption', () => { pubnub = new PubNub({ - subscribeKey: SUBSCRIBE_KEY, - publishKey: PUBLISH_KEY, + subscribeKey: process.env.SUBSCRIBE_KEY || 'demo', + publishKey: process.env.PUBLISH_KEY || 'demo', uuid: UUID, }); @@ -166,7 +163,7 @@ describe('test', () => { const result = await pubnub.sendFile({ channel: CHANNEL_1, file: { data: testContent, name: 'someFile.txt', mimeType: 'text/plain' }, - cipherKey: 'cipherKey' + cipherKey: 'cipherKey', }); expect(result.name).to.equal('someFile.txt'); @@ -175,7 +172,7 @@ describe('test', () => { channel: CHANNEL_1, id: result.id, name: result.name, - cipherKey: 'cipherKey' + cipherKey: 'cipherKey', }); fileId = result.id; diff --git a/test/old_contract/world.ts b/test/old_contract/world.ts index 79a4577c5..e5c311258 100644 --- a/test/old_contract/world.ts +++ b/test/old_contract/world.ts @@ -39,13 +39,13 @@ class PubnubWorld extends World { subscribeKey: 'demo', }, accessManagerKeyset: { - publishKey: process.env.PUBLISH_KEY_ACCESS || 'pub-key', - subscribeKey: process.env.SUBSCRIBE_KEY_ACCESS || 'sub-key', - secretKey: process.env.SECRET_KEY_ACCESS || 'secret-key', + publishKey: process.env.PAM_PUBLISH_KEY || 'pub-key', + subscribeKey: process.env.PAM_SUBSCRIBE_KEY || 'sub-key', + secretKey: process.env.PAM_SECRET_KEY || 'secret-key', }, accessManagerWithoutSecretKeyKeyset: { - publishKey: process.env.PUBLISH_KEY_ACCESS || 'pub-key', - subscribeKey: process.env.SUBSCRIBE_KEY_ACCESS || 'sub-key', + publishKey: process.env.PAM_PUBLISH_KEY || 'pub-key', + subscribeKey: process.env.PAM_SUBSCRIBE_KEY || 'sub-key', }, tokenWithKnownAuthorizedUUID: 'qEF2AkF0GmEI03xDdHRsGDxDcmVzpURjaGFuoWljaGFubmVsLTEY70NncnChb2NoYW5uZWxfZ3JvdXAtMQVDdXNyoENzcGOgRHV1aWShZnV1aWQtMRhoQ3BhdKVEY2hhbqFtXmNoYW5uZWwtXFMqJBjvQ2dycKF0XjpjaGFubmVsX2dyb3VwLVxTKiQFQ3VzcqBDc3BjoER1dWlkoWpedXVpZC1cUyokGGhEbWV0YaBEdXVpZHR0ZXN0LWF1dGhvcml6ZWQtdXVpZENzaWdYIPpU-vCe9rkpYs87YUrFNWkyNq8CVvmKwEjVinnDrJJc',