-
Notifications
You must be signed in to change notification settings - Fork 6
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
AA test for Search Results #3053
Conversation
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. Rendering app PR: alphagov/finder-frontend#3053
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. Rendering app PR: alphagov/finder-frontend#3053
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. Rendering app PR: alphagov/finder-frontend#3053
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Leena mentioned, convention is to put the controller parts of the config in a concern. This test doesn't have any logic though, so it's probably OK. You might want the practise!
@@ -8,6 +8,16 @@ class FindersController < ApplicationController | |||
def show | |||
slimmer_template "gem_layout_full_width" if i_am_a_topic_page_finder | |||
|
|||
ab_test = GovukAbTesting::AbTest.new( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The AB test will run on every page shown by this action, which might not be desired if K&C just want results from /search/all.
You could add a page_under_test?
method that tests whether the path is /search/all
, and wrap this logic in that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I checked with them and they only want it on /search/all... which makes sense as this is what they will want to test with the real AB test! Thanks for flagging. I have updated it to use the constraint.
@@ -66,6 +66,10 @@ | |||
<% end %> | |||
</div> | |||
|
|||
<% content_for :meta_tags do %> | |||
<%= @requested_variant.analytics_meta_tag.html_safe %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you do add a page_under_test?
method, you'd need to wrap this bit in it too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
"EsSixPointSeven", | ||
dimension: 1, | ||
allowed_variants: %w[A B Z], | ||
control_variant: "Z", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ca70d08
to
ea30764
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks ok. I've added a couple of suggestions for keeping the AB test code out of controller. I pretty much "borrowed" all suggestions from Kelvin 😅
@@ -353,4 +359,8 @@ def filter_query_array(arr) | |||
arr.reject { |v| v == "all" }.compact.presence | |||
end | |||
end | |||
|
|||
def page_under_test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be moved to the concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
if page_under_test? | ||
@requested_variant = elastic_search_aa_test.requested_variant(request.headers) | ||
@requested_variant.configure_response(response) | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of this can be moved to the concern too, to keep the controller tidy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
Thanks for the suggestions @leenagupte. I have fixed up :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. The concern is really nice.
I have one comment because I'm a bit confused by one of the tests.
expect(response.body).to include("EsSixPointSeven:#{variant}") | ||
end | ||
|
||
it "doesn't render the #{variant} for finders" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
end | ||
end | ||
|
||
it "should render the page without an AB test variant for search" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow how this test is different from "renders the #{variant} variant for /search/all pages". Is it because the variant is not being passed in the header? But the Vary header is still being set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, tbh this was more out of paranoia to test that the page would still render if something went wrong with setting the variant, but its probably not needed as it should work!
38587e2
to
a2000d2
Compare
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. Rendering app PR: alphagov/finder-frontend#3053
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. This test is only applied to /search/all results, not to finder search results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - thanks Rosa 👍
Removing this code as the AA test has been run. There is however a chance that we will run a throttled version of the same test in a few weeks... Given that it is being removed from the CDN config, I also decided to fully remove the configuration from here, as it will be quick enough to bring it back again in a few weeks if required. PR to implment the AA test config: #3053
We recently ran an AA test for the Search team (#3053). We are going to run it again, hence reinstating it in this PR! The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. This time around, the code will stay the same. We will use the same custom dimension and the variant split will still be 50/50. The only difference is that the custom dimension has been scoped as ‘user' as opposed to ‘session’ like it was last time. Scoping the custom dimension has already been done by a performance analyst. We plan to deploy this on Thursday 17 August for 1 week.
We recently ran an AA test for the Search team (#3053). We are going to run it again, hence reinstating it in this PR! The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. This time around, the code will stay the same. We will use the same custom dimension and the variant split will still be 50/50. The only difference is that the custom dimension has been scoped as ‘user' as opposed to ‘session’ like it was last time. Scoping the custom dimension has already been done by a performance analyst. We plan to deploy this on Thursday 17 August for 1 week.
We recently ran an AA test for the Search team (#3053). We are going to run it again, hence reinstating it in this PR! The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests. This time around, the code will stay the same. We will use the same custom dimension and the variant split will still be 50/50. The only difference is that the custom dimension has been scoped as ‘user' as opposed to ‘session’ like it was last time. Scoping the custom dimension has already been done by a performance analyst. We plan to deploy this on Thursday 17 August for 1 week.
Trello
The purpose of the A/A test is to test the % of allocation of traffic/sample population based on the current version of elastic (6.7) against itself. A (ES 6.7) vs A (ES6.7). The A/A is solely to identify how the approach allocates traffic. This will provide benchmark data to aid analysis in future AA tests.
This test is only applied to
/search/all
results, not to finder search results.Manual testing using Postman on /search/all for the different variants
A finder search results page, which the test is not applied to:
Follow these steps if you are doing a Rails upgrade.