You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The address field is optional and if we are unlucky then scalacheck will generate Person("some name", None)
which circe golden will serialize to
{
"name": "some name",
"address": null
}
Unfortunately this means that the address subtree is effectively untested for backwards compatiblity. For example,
the following breaking change to the codec for address still passes the golden tests
I think this exhibits a larger problem, in which you can't be sure that the generated cases will cover all branches of an ADT (in this case, Option). Personally I try to ensure the examples I get contain at least one of each branch, otherwise I regenerate the example (albeit inefficient, it seems to work). Still, it'd be great if there was something more automated to do this.
I think this exhibits a larger problem, in which you can't be sure that the generated cases will cover all branches of an ADT (in this case, Option). Personally I try to ensure the examples I get contain at least one of each branch, otherwise I regenerate the example (albeit inefficient, it seems to work). Still, it'd be great if there was something more automated to do this.
Opening this to see if anyone has found a better solution to this.
Consider for example:
The
address
field is optional and if we are unlucky then scalacheck will generatePerson("some name", None)
which circe golden will serialize to
Unfortunately this means that the
address
subtree is effectively untested for backwards compatiblity. For example,the following breaking change to the codec for
address
still passes the golden testsI've hacked around it using circe-droste:
but was wondering if anyone had a better solution? Or if things would go terribly wrong if circe-golden did this by default?
The text was updated successfully, but these errors were encountered: