Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FSSDK-10766] UPS batch processing #953

Merged
merged 9 commits into from
Nov 4, 2024
17 changes: 8 additions & 9 deletions lib/core/decision_service/index.tests.js
junaed-optimizely marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ describe('lib/core/decision_service', function() {
);
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[4]),
'DECISION_SERVICE: Saved variation "control" of experiment "testExperiment" for user "decision_service_user".'
'DECISION_SERVICE: Saved user profile for user "decision_service_user".'
);
});

Expand All @@ -399,11 +399,11 @@ describe('lib/core/decision_service', function() {
sinon.assert.calledWith(userProfileLookupStub, 'decision_service_user');
sinon.assert.calledOnce(bucketerStub); // should still go through with bucketing
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[0]),
buildLogMessageFromArgs(mockLogger.log.args[1]),
'DECISION_SERVICE: User decision_service_user is not in the forced variation map.'
);
assert.strictEqual(
buildLogMessageFromArgs(mockLogger.log.args[1]),
buildLogMessageFromArgs(mockLogger.log.args[0]),
junaed-optimizely marked this conversation as resolved.
Show resolved Hide resolved
'DECISION_SERVICE: Error while looking up user profile for user ID "decision_service_user": I am an error.'
);
});
Expand Down Expand Up @@ -1277,7 +1277,7 @@ describe('lib/core/decision_service', function() {
reasons: [],
};
experiment = configObj.experimentIdMap['594098'];
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
getVariationStub.withArgs(configObj, experiment, user).returns(fakeDecisionResponseWithArgs);
});
Expand Down Expand Up @@ -1493,12 +1493,11 @@ describe('lib/core/decision_service', function() {
decisionSource: DECISION_SOURCES.FEATURE_TEST,
};
assert.deepEqual(decision, expectedDecision);
sinon.assert.calledWithExactly(
sinon.assert.calledWith(
getVariationStub,
configObj,
experiment,
user,
{}
);
});
});
Expand All @@ -1511,7 +1510,7 @@ describe('lib/core/decision_service', function() {
optimizely: {},
userId: 'user1',
});
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
});

Expand Down Expand Up @@ -1550,7 +1549,7 @@ describe('lib/core/decision_service', function() {
result: 'var',
reasons: [],
};
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponseWithArgs);
getVariationStub.withArgs(configObj, 'exp_with_group', user).returns(fakeDecisionResponseWithArgs);
});
Expand Down Expand Up @@ -1607,7 +1606,7 @@ describe('lib/core/decision_service', function() {
optimizely: {},
userId: 'user1',
});
getVariationStub = sandbox.stub(decisionServiceInstance, 'getVariation');
getVariationStub = sandbox.stub(decisionServiceInstance, 'resolveVariation');
getVariationStub.returns(fakeDecisionResponse);
});

Expand Down
Loading
Loading