mint-metrics / mojito-js-delivery

🧪 Source-controlled JS split testing framework for building and launching A/B tests.
https://mojito.mx/docs/js-delivery-intro
Other
16 stars 29 forks source link

Refactoring on how to choose recipe with sampleRate values #33

Closed allmywant closed 4 years ago

allmywant commented 4 years ago

Now maximum calls of getRandom is 3, when recipes has same sampleRate values.

kingo55 commented 4 years ago

Also, would it be worth having another unit test that checks recipes with different and same sample rates, out of order reliably return a specific recipe?

E.g. We have 5 recipes:

  1. 0.4
  2. 0.1
  3. 0.1
  4. 0.2
  5. 0.2

And we check that for decision = 0.15 we always get recipe 3, for decision = 0.55 we always get recipe 4, and for decision = 0.65 we get recipe 1.

Or is there a better way to check that decisions always yield the same recipes?

allmywant commented 4 years ago

@kingo55 You're right, I will add a unit test to test this. BTW: I think this pr might has confilcts with Sam's (#37 ), I can wait until Sam's pr was merged, then close this pr and I will create a new one based on Sam's changes.

allmywant commented 4 years ago

I've sent another PR, closing this one.