Closed seancribbs closed 9 years ago
Now that my EQC is back online:
All 288 tests passed.
:+1: 2edaf38
@javajolt Even though it passed this time, I should probably fix it so it doesn't randomly fail again. Hold on.
Looks like repeated test runs are now passing:
All 288 tests passed.
:+1: 52041cd
@borshop merge
In an effort to discover the nested errors that can/do occur in Riak's schemas, this substantially refactors the code in
cuttlefish_generator
.This PR targets
develop
but should also be backported/merged to2.0
branch for the next patch release.One source of the problem (as shown in the backtrace in basho/riak#590) was that "extended" datatypes that failed to parse halted all attempts to parse other datatypes in the list. This meant that when calling
cuttlefish_generator:map/2
, if something was already coerced to a valid datatype, it might fail to parse as the extended type and result in the nested configuration failing.The main refactors are:
cuttlefish_generator:apply_translations()
up into smaller, more digestible functions with fewer responsibilities.cuttlefish_datatypes:from_string()
andto_string()
that caused things likelist_to_atom(36000)
(as in the example in basho/riak#590).cuttlefish_generator:transform_type()
so that the functions it calls are not mutually recursive. The control flow was extracted out into a monadic combinatorfoldm_either
, while the nested calls simply return{ok, Value}
or{error, Reason}
.cuttlefish_variable:format/1
exists. Found and fixed a resulting bug incuttlefish_escript:describe/2
.