Before users adopt Frankenstein, they would already have a control code path, that is most likely already tested.
When they adopt Frankenstein, they most likely want to also test that if the candidate branch is ran instead, then their existing test should still pass.
Frankenstein right now has no ability to return candidate result; it always return control result, so this becomes impossible.
We can think about an API like
Frankenstein.adopt(fn ->
do_something()
end)
where do_something/0 will hit a Frankenstein.run/1 that will instead return the candidate result. Potentially look into nimble_ownership for inspiration.
Alternatively, what would also be nice is the ability to automatically let users run two versions of tests. For example, proposed API
@frankenstein true
test "coconut" do
do_something()
end
this tag, somehow making us compile two version of test on compile time, so the output will be:
# the OG control
test "coconut" do
do_something()
end
# the candidate branch
test "(frankenstein) coconut" do
Frankenstein.adopt(fn ->
do_something() # this is the candidate branch
end)
end
Before users adopt Frankenstein, they would already have a
controlcode path, that is most likely already tested.When they adopt Frankenstein, they most likely want to also test that if the candidate branch is ran instead, then their existing test should still pass.
Frankenstein right now has no ability to return candidate result; it always return control result, so this becomes impossible.
We can think about an API like
where
do_something/0will hit aFrankenstein.run/1that will instead return the candidate result. Potentially look intonimble_ownershipfor inspiration.Alternatively, what would also be nice is the ability to automatically let users run two versions of tests. For example, proposed API
this tag, somehow making us compile two version of test on compile time, so the output will be: