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

Test scaffolding command or A/A test generation #8

Closed kingo55 closed 4 years ago

kingo55 commented 4 years ago

To make it easy for new users to get started, we could have a test scaffolding command to create a live A/A test in the waves directory:

id: aa1
name: AA test 1
sampleRate: 1
state: live
trigger: trigger.js
recipes:
  0:
    name: A1
  1:
    name: A2
function trigger(test)
{
  test.activate();
}

A simple gulp command would generate the files needed:

gulp scaffold

Not attached to this particular naming - might be a better term we could use here.

allmywant commented 4 years ago

@kingo55 Good idea!

dapperdrop commented 4 years ago

I like this. We could also have multiple scaffold templates setup to showcase some simple experiments / triggers. I.e. prefill some treatment JS files with innocuous code, like printing something to the console. Users can then use them as a launch pad to their own experiments.

E.g.

kingo55 commented 4 years ago

Feels like we also need a scaffold for new tests we're setting up too. It'll save the 15 seconds creating the test YAML and include files:

$ gulp scaffold w212

Then it creates all the necessary files:

And for scaffold demo/AA tests we could try something like this:

$ gulp scaffold-demo
$ gulp scaffold-aa
dapperdrop commented 4 years ago

That would be handy! Not sure if we should scaffold shared files as it's not a common pattern and would more than likely result in users deleting them in the setup process.

I reckon MVP would be:

config.yml
trigger.js

And probably 1.js

kingo55 commented 4 years ago

Closed via #19