From b4bc092c720349a5a58e12e4bb92d6971dc85a6e Mon Sep 17 00:00:00 2001 From: Lewis Marshall Date: Wed, 3 Jul 2024 22:53:31 +0100 Subject: [PATCH] WIP test against the lmars-dev cluster Signed-off-by: Lewis Marshall --- test/common/globals/environment.js | 2 +- .../browser/template/playwright/index.tsx | 2 +- .../browser/template/src/index-default.ts | 2 +- .../browser/template/src/index-modular.ts | 2 +- test/package/browser/template/src/sandbox.ts | 2 +- test/realtime/connectivity.test.js | 2 +- test/rest/defaults.test.js | 28 +++++++++---------- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/common/globals/environment.js b/test/common/globals/environment.js index f1515222f8..55bc949ff6 100644 --- a/test/common/globals/environment.js +++ b/test/common/globals/environment.js @@ -3,7 +3,7 @@ define(function (require) { var defaultLogLevel = 4, environment = isBrowser ? window.__env__ || {} : process.env, - ablyEnvironment = environment.ABLY_ENV || 'sandbox', + ablyEnvironment = environment.ABLY_ENV || 'lmars-dev', realtimeHost = environment.ABLY_REALTIME_HOST, restHost = environment.ABLY_REST_HOST, port = environment.ABLY_PORT || 80, diff --git a/test/package/browser/template/playwright/index.tsx b/test/package/browser/template/playwright/index.tsx index 5b17f5d566..2107acd572 100644 --- a/test/package/browser/template/playwright/index.tsx +++ b/test/package/browser/template/playwright/index.tsx @@ -9,7 +9,7 @@ beforeMount(async ({ App }) => { const client = new Ably.Realtime({ key, - environment: 'sandbox', + environment: 'lmars-dev', }); return ( diff --git a/test/package/browser/template/src/index-default.ts b/test/package/browser/template/src/index-default.ts index cda822d21b..dea794efb8 100644 --- a/test/package/browser/template/src/index-default.ts +++ b/test/package/browser/template/src/index-default.ts @@ -9,7 +9,7 @@ async function attachChannel(channel: Ably.RealtimeChannel) { globalThis.testAblyPackage = async function () { const key = await createSandboxAblyAPIKey(); - const realtime = new Ably.Realtime({ key, environment: 'sandbox' }); + const realtime = new Ably.Realtime({ key, environment: 'lmars-dev' }); const channel = realtime.channels.get('channel'); await attachChannel(channel); diff --git a/test/package/browser/template/src/index-modular.ts b/test/package/browser/template/src/index-modular.ts index a9186f56dd..a9207b8d98 100644 --- a/test/package/browser/template/src/index-modular.ts +++ b/test/package/browser/template/src/index-modular.ts @@ -18,7 +18,7 @@ async function checkStandaloneFunction() { globalThis.testAblyPackage = async function () { const key = await createSandboxAblyAPIKey(); - const realtime = new BaseRealtime({ key, environment: 'sandbox', plugins: { WebSocketTransport, FetchRequest } }); + const realtime = new BaseRealtime({ key, environment: 'lmars-dev', plugins: { WebSocketTransport, FetchRequest } }); const channel = realtime.channels.get('channel'); await attachChannel(channel); diff --git a/test/package/browser/template/src/sandbox.ts b/test/package/browser/template/src/sandbox.ts index 100ab22f00..bd2d531585 100644 --- a/test/package/browser/template/src/sandbox.ts +++ b/test/package/browser/template/src/sandbox.ts @@ -1,7 +1,7 @@ import testAppSetup from '../../../../common/ably-common/test-resources/test-app-setup.json'; export async function createSandboxAblyAPIKey() { - const response = await fetch('https://sandbox-rest.ably.io/apps', { + const response = await fetch('https://lmars-dev-rest.ably.io/apps', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(testAppSetup.post_apps), diff --git a/test/realtime/connectivity.test.js b/test/realtime/connectivity.test.js index ba2c408323..f83419e0f3 100644 --- a/test/realtime/connectivity.test.js +++ b/test/realtime/connectivity.test.js @@ -101,7 +101,7 @@ define(['ably', 'shared_helper', 'chai'], function (Ably, helper, chai) { it('succeeds with plain url', function (done) { whenPromiseSettles( - new helper.AblyRealtime(options('sandbox-rest.ably.io/time')).http.checkConnectivity(), + new helper.AblyRealtime(options('lmars-dev-rest.ably.io/time')).http.checkConnectivity(), function (err, res) { try { expect(res && !err, 'Connectivity check completed ' + (err && utils.inspectError(err))).to.be.ok; diff --git a/test/rest/defaults.test.js b/test/rest/defaults.test.js index 212b768a63..6b379afdcf 100644 --- a/test/rest/defaults.test.js +++ b/test/rest/defaults.test.js @@ -42,20 +42,20 @@ define(['ably', 'chai'], function (Ably, chai) { }); it('Init with given environment', function () { - var normalisedOptions = Defaults.normaliseOptions({ environment: 'sandbox' }, null, null); + var normalisedOptions = Defaults.normaliseOptions({ environment: 'lmars-dev' }, null, null); - expect(normalisedOptions.restHost).to.equal('sandbox-rest.ably.io'); - expect(normalisedOptions.realtimeHost).to.equal('sandbox-realtime.ably.io'); + expect(normalisedOptions.restHost).to.equal('lmars-dev-rest.ably.io'); + expect(normalisedOptions.realtimeHost).to.equal('lmars-dev-realtime.ably.io'); expect(normalisedOptions.port).to.equal(80); expect(normalisedOptions.tlsPort).to.equal(443); - expect(normalisedOptions.fallbackHosts.sort()).to.deep.equal(Defaults.environmentFallbackHosts('sandbox').sort()); + expect(normalisedOptions.fallbackHosts.sort()).to.deep.equal(Defaults.environmentFallbackHosts('lmars-dev').sort()); expect(normalisedOptions.tls).to.equal(true); expect(Defaults.getHosts(normalisedOptions).length).to.deep.equal(4); expect(Defaults.getHosts(normalisedOptions)[0]).to.deep.equal(normalisedOptions.restHost); - expect(Defaults.getHost(normalisedOptions, 'sandbox-rest.ably.io', false)).to.deep.equal('sandbox-rest.ably.io'); - expect(Defaults.getHost(normalisedOptions, 'sandbox-rest.ably.io', true)).to.deep.equal( - 'sandbox-realtime.ably.io', + expect(Defaults.getHost(normalisedOptions, 'lmars-dev-rest.ably.io', false)).to.deep.equal('lmars-dev-rest.ably.io'); + expect(Defaults.getHost(normalisedOptions, 'lmars-dev-rest.ably.io', true)).to.deep.equal( + 'lmars-dev-realtime.ably.io', ); expect(Defaults.getPort(normalisedOptions)).to.equal(443); @@ -122,21 +122,21 @@ define(['ably', 'chai'], function (Ably, chai) { }); it('Init with no endpoint-related options and given default environment', function () { - Defaults.ENVIRONMENT = 'sandbox'; + Defaults.ENVIRONMENT = 'lmars-dev'; var normalisedOptions = Defaults.normaliseOptions({}, null, null); - expect(normalisedOptions.restHost).to.equal('sandbox-rest.ably.io'); - expect(normalisedOptions.realtimeHost).to.equal('sandbox-realtime.ably.io'); + expect(normalisedOptions.restHost).to.equal('lmars-dev-rest.ably.io'); + expect(normalisedOptions.realtimeHost).to.equal('lmars-dev-realtime.ably.io'); expect(normalisedOptions.port).to.equal(80); expect(normalisedOptions.tlsPort).to.equal(443); - expect(normalisedOptions.fallbackHosts.sort()).to.deep.equal(Defaults.environmentFallbackHosts('sandbox').sort()); + expect(normalisedOptions.fallbackHosts.sort()).to.deep.equal(Defaults.environmentFallbackHosts('lmars-dev').sort()); expect(normalisedOptions.tls).to.equal(true); expect(Defaults.getHosts(normalisedOptions).length).to.equal(4); expect(Defaults.getHosts(normalisedOptions)[0]).to.deep.equal(normalisedOptions.restHost); - expect(Defaults.getHost(normalisedOptions, 'sandbox-rest.ably.io', false)).to.deep.equal('sandbox-rest.ably.io'); - expect(Defaults.getHost(normalisedOptions, 'sandbox-rest.ably.io', true)).to.deep.equal( - 'sandbox-realtime.ably.io', + expect(Defaults.getHost(normalisedOptions, 'lmars-dev-rest.ably.io', false)).to.deep.equal('lmars-dev-rest.ably.io'); + expect(Defaults.getHost(normalisedOptions, 'lmars-dev-rest.ably.io', true)).to.deep.equal( + 'lmars-dev-realtime.ably.io', ); expect(Defaults.getPort(normalisedOptions)).to.equal(443);