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

Framework: return storedVariation if we have one #6904

Merged
merged 1 commit into from
Jul 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/lib/abtest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {

You should include the following information:

* `datestamp` - The YYYMMDD date you want to start tracking the results of the test. If you deploy to production prior to this date, the `abtest` function (see below) will return the value you set for `defaultVariation` and won't track the results.
* `datestamp` - The YYYMMDD date you want to start tracking the results of the test. If you deploy to production prior to this date, the `abtest` function (see below) will return the any stored variation (which makes for easier testing) or the value you set for `defaultVariation` and won't track the results.
* `variations` - An object where the keys are the variation names and the values are the allocations. The variation names should be descriptive (don't use `variationA`, `original`, etc). The allocations (50/50) are how you want those variations to be allocated to users. For example, you could also do 90/10 if you want one variation to be shown to only 10% of users. 90/10 is the same as 9/1. If you had three variations you could do 1/1/1 to show each variation one third of the time.
* `defaultVariation` - The variation to assign users who are not eligible to participate in the test. See the "Dealing with ineligible users" section below for more information.

Expand Down
2 changes: 1 addition & 1 deletion client/lib/abtest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ ABTest.prototype.getVariationAndSetAsNeeded = function() {

if ( ! this.hasTestStartedYet() ) {
debug( '%s: Test will start on %s.', this.experimentId, this.datestamp );
return this.defaultVariation;
return savedVariation || this.defaultVariation;
}

if ( savedVariation && includes( this.variationNames, savedVariation ) ) {
Expand Down