diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index ab615f33b888..ade1dcd61234 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -266,15 +266,6 @@ jobs: working-directory: ${{ env.special-working-directory }} if: matrix.test-suite == 'single-workspace' - - name: Run multi-workspace tests - env: - CI_PYTHON_VERSION: ${{ matrix.python }} - uses: GabrielBB/xvfb-action@v1.6 - with: - run: npm run testMultiWorkspace - working-directory: ${{ env.special-working-directory }} - if: matrix.test-suite == 'multi-workspace' - - name: Run debugger tests env: CI_PYTHON_VERSION: ${{ matrix.python }} diff --git a/src/client/common/experiments/service.ts b/src/client/common/experiments/service.ts index 39319ab2a363..270f91512809 100644 --- a/src/client/common/experiments/service.ts +++ b/src/client/common/experiments/service.ts @@ -142,7 +142,7 @@ export class ExperimentService implements IExperimentService { // it means that the value for this experiment was not found on the server. const treatmentVariable = this.experimentationService.getTreatmentVariable(EXP_CONFIG_ID, experiment); - return treatmentVariable !== undefined; + return treatmentVariable === true; } public async getExperimentValue(experiment: string): Promise { diff --git a/src/test/common/experiments/service.unit.test.ts b/src/test/common/experiments/service.unit.test.ts index 1c61d2fa50f0..1d96f2e0bd70 100644 --- a/src/test/common/experiments/service.unit.test.ts +++ b/src/test/common/experiments/service.unit.test.ts @@ -177,7 +177,7 @@ suite('Experimentation service', () => { telemetryEvents.push(telemetry); }); - getTreatmentVariable = sinon.stub().returns(Promise.resolve(true)); + getTreatmentVariable = sinon.stub().returns(true); sinon.stub(tasClient, 'getExperimentationService').returns(({ getTreatmentVariable, } as unknown) as tasClient.IExperimentationService); @@ -205,6 +205,37 @@ suite('Experimentation service', () => { sinon.assert.calledOnce(getTreatmentVariable); }); + test('If in control group, return false', async () => { + sinon.restore(); + sendTelemetryEventStub = sinon + .stub(Telemetry, 'sendTelemetryEvent') + .callsFake((eventName: string, _, properties: unknown) => { + const telemetry = { eventName, properties }; + telemetryEvents.push(telemetry); + }); + + // Control group returns false. + getTreatmentVariable = sinon.stub().returns(false); + sinon.stub(tasClient, 'getExperimentationService').returns(({ + getTreatmentVariable, + } as unknown) as tasClient.IExperimentationService); + + configureApplicationEnvironment('stable', extensionVersion); + + configureSettings(true, [], []); + + const experimentService = new ExperimentService( + instance(workspaceService), + instance(appEnvironment), + instance(stateFactory), + ); + const result = experimentService.inExperimentSync(experiment); + + assert.isFalse(result); + sinon.assert.notCalled(sendTelemetryEventStub); + sinon.assert.calledOnce(getTreatmentVariable); + }); + test('If the experiment setting is disabled, inExperiment should return false', async () => { configureSettings(false, [], []);