diff --git a/.harness/ci-cd.yaml b/.harness/ci-cd.yaml index c55ce475d..089f303e7 100644 --- a/.harness/ci-cd.yaml +++ b/.harness/ci-cd.yaml @@ -16,6 +16,19 @@ pipeline: identifier: Check_Test_Build_Upload description: "" type: CI + # drone-s3 plugin settings for the S3Upload steps (not exposed as step spec fields). + # PLUGIN_CACHE_CONTROL is a plain string, so drone-s3 maps it to the ".*" regex key (all files). + # PLUGIN_STRIP_PREFIX removes "umd/" so object keys become sdk/ instead of sdk/umd/. + variables: + - name: PLUGIN_ACL + type: String + value: public-read + - name: PLUGIN_CACHE_CONTROL + type: String + value: max-age=31536000,public + - name: PLUGIN_STRIP_PREFIX + type: String + value: umd/ spec: cloneCodebase: true caching: @@ -28,7 +41,7 @@ pipeline: runtime: type: Cloud spec: - size: small + size: large imageSpec: imageName: ubuntu-latest buildIntelligence: @@ -128,7 +141,8 @@ pipeline: connectorRef: publicassetsstage region: us-east-1 bucket: split-public-stage - sourcePath: ./umd/* + sourcePath: umd/* + target: sdk when: stageStatus: Success condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "development" @@ -140,7 +154,8 @@ pipeline: connectorRef: publicassetsprod region: us-east-1 bucket: split-public - sourcePath: ./umd/* + sourcePath: umd/* + target: sdk when: stageStatus: Success condition: <+trigger.event> == "PUSH" && <+trigger.branch> == "main" diff --git a/package-lock.json b/package-lock.json index 3a102bfb3..ce25123b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@splitsoftware/splitio", - "version": "11.11.2-rc.1", + "version": "11.11.2-rc.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@splitsoftware/splitio", - "version": "11.11.2-rc.1", + "version": "11.11.2-rc.2", "license": "Apache-2.0", "dependencies": { "@splitsoftware/splitio-commons": "2.12.1", diff --git a/package.json b/package.json index a52c1dcd9..32b56e696 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/splitio", - "version": "11.11.2-rc.1", + "version": "11.11.2-rc.2", "description": "Split SDK", "files": [ "README.md", diff --git a/src/__tests__/offline/browser.spec.js b/src/__tests__/offline/browser.spec.js index 89726352e..cda953afe 100644 --- a/src/__tests__/offline/browser.spec.js +++ b/src/__tests__/offline/browser.spec.js @@ -264,7 +264,7 @@ tape('Browser offline mode', function (assert) { setTimeout(() => { factory.settings.features = { testing_split: 'on', testing_split_with_config: { treatment: 'off', config: '{ "color": "blue" }' } }; }, 750); // once updated, test again. - client.once(client.Event.SDK_UPDATE, function () { + client.once(client.Event.SDK_UPDATE, async () => { assert.true((Date.now() - readyTimestamp) > 1000, 'Should only emit SDK_UPDATE after a real update.'); client.once(client.Event.SDK_UPDATE, function () { assert.fail('Should not emit a second SDK_UPDATE event'); }); @@ -341,41 +341,43 @@ tape('Browser offline mode', function (assert) { testing_not_exist: { treatment: 'control', config: null } }); - // wait for SDK_UPDATE on all factories - waitUntil(() => updateCount === factories.length - 1).then(() => { - const destroyPromises = [ - sharedClient.destroy(), client.destroy(), - ...factories.map(f => f.client().destroy()) - ]; - - // When both promises have been resolved, we check for network activity - Promise.all(destroyPromises).then(() => { - // We test the breakdown instead of just the misc because it's faster to spot where the issue is - assert.notOk(spySplitChanges.called, 'On offline mode we should not call the splitChanges endpoint.'); - assert.notOk(spySegmentChanges.called, 'On offline mode we should not call the segmentChanges endpoint.'); - assert.notOk(spyMemberships.called, 'On offline mode we should not call the Memberships endpoint.'); - assert.notOk(spyEventsBulk.called, 'On offline mode we should not call the events endpoint.'); - assert.notOk(spyTestImpressionsBulk.called, 'On offline mode we should not call the impressions endpoint.'); - assert.notOk(spyTestImpressionsCount.called, 'On offline mode we should not call the impressions count endpoint.'); - assert.notOk(spyMetricsTimes.called, 'On offline mode we should not call the metric times endpoint.'); - assert.notOk(spyMetricsCounters.called, 'On offline mode we should not call the metric counters endpoint.'); - assert.notOk(spyAny.called, 'On offline mode we should NOT call to ANY endpoint, we are completely isolated from BE.'); - - // SDK events on shared client - assert.equal(sharedReadyCount, 1, 'Shared client should have emitted SDK_READY event once'); - assert.equal(sharedUpdateCount, 1, 'Shared client should have emitted SDK_UPDATE event once'); - - // SDK events on other factory clients - assert.equal(readyCount, factories.length, 'Each factory client should have emitted SDK_READY event once'); - assert.equal(updateCount, factories.length - 1, 'Each factory client except one should have emitted SDK_UPDATE event once'); - assert.equal(readyFromCacheCount, 2, 'The main and shared client of the factory with LOCALSTORAGE should have emitted SDK_READY_FROM_CACHE event'); - - assert.end(); - }); - }, err => { + try { + // wait for SDK_UPDATE on all factories + await waitUntil(() => updateCount === factories.length - 1); + } catch (err) { assert.fail(err.message); assert.end(); - }); + } + + const destroyPromises = [ + sharedClient.destroy(), client.destroy(), + ...factories.map(f => f.client().destroy()) + ]; + + // When both promises have been resolved, we check for network activity + await Promise.all(destroyPromises); + + // We test the breakdown instead of just the misc because it's faster to spot where the issue is + assert.notOk(spySplitChanges.called, 'On offline mode we should not call the splitChanges endpoint.'); + assert.notOk(spySegmentChanges.called, 'On offline mode we should not call the segmentChanges endpoint.'); + assert.notOk(spyMemberships.called, 'On offline mode we should not call the Memberships endpoint.'); + assert.notOk(spyEventsBulk.called, 'On offline mode we should not call the events endpoint.'); + assert.notOk(spyTestImpressionsBulk.called, 'On offline mode we should not call the impressions endpoint.'); + assert.notOk(spyTestImpressionsCount.called, 'On offline mode we should not call the impressions count endpoint.'); + assert.notOk(spyMetricsTimes.called, 'On offline mode we should not call the metric times endpoint.'); + assert.notOk(spyMetricsCounters.called, 'On offline mode we should not call the metric counters endpoint.'); + assert.notOk(spyAny.called, 'On offline mode we should NOT call to ANY endpoint, we are completely isolated from BE.'); + + // SDK events on shared client + assert.equal(sharedReadyCount, 1, 'Shared client should have emitted SDK_READY event once'); + assert.equal(sharedUpdateCount, 1, 'Shared client should have emitted SDK_UPDATE event once'); + + // SDK events on other factory clients + assert.equal(readyCount, factories.length, 'Each factory client should have emitted SDK_READY event once'); + assert.equal(updateCount, factories.length - 1, 'Each factory client except one should have emitted SDK_UPDATE event once'); + assert.equal(readyFromCacheCount, 2, 'The main and shared client of the factory with LOCALSTORAGE should have emitted SDK_READY_FROM_CACHE event'); + + assert.end(); }); }); }); diff --git a/src/settings/defaults/version.js b/src/settings/defaults/version.js index b2584aa05..f6e3afdc2 100644 --- a/src/settings/defaults/version.js +++ b/src/settings/defaults/version.js @@ -1 +1 @@ -export const packageVersion = '11.11.2-rc.1'; +export const packageVersion = '11.11.2-rc.2';