mina icon indicating copy to clipboard operation
mina copied to clipboard

Add roundtrip test for GraphQL scalar types

Open ebresafegaga opened this issue 3 years ago • 3 comments

Closes #11559

ebresafegaga avatar Aug 18 '22 07:08 ebresafegaga

Currently, the tests for these two graphql scalar types are not yet implemented:

  • Mina_transaction.Transaction_hash.t
  • Mina_block.Precomputed.Proof.t

We've used quickcheck for the tests here, and we need generator functions for the aforementioned types, but we can't implement the generator functions becuase:

  • Mina_transaction.Transaction_hash.t is backed by an abstract type from the blake2 / digestif library
  • The implementation of Mina_block.Precomputed.Proof.t a very large GADT type. Also, GADT types cannot derive quickcheck using [@@deriving quickcheck] to automatically give generator functions.

I suggest we move the tests for these types to another issue.

ebresafegaga avatar Aug 31 '22 10:08 ebresafegaga

If there are no generators yet, and they are hard to write, then I'd suggest we use a couple of manual test cases for the roundtrip tests for those two types, for now.

kantp avatar Aug 31 '22 14:08 kantp

Currently, the tests for these two graphql scalar types are not yet implemented:

  • Mina_transaction.Transaction_hash.t
  • Mina_block.Precomputed.Proof.t

We've used quickcheck for the tests here, and we need generator functions for the aforementioned types, but we can't implement the generator functions becuase:

  • Mina_transaction.Transaction_hash.t is backed by an abstract type from the blake2 / digestif library
  • The implementation of Mina_block.Precomputed.Proof.t a very large GADT type. Also, GADT types cannot derive quickcheck using [@@deriving quickcheck] to automatically give generator functions.

I suggest we move the tests for these types to another issue.

I have written quickcheck tests for Mina_transaction.Transaction_hash.t, and a manual test for Mina_block.Precomputed.Proof.t. I think this is ready for review now.

(EDIT: Mina_block.Precomputed.Proof.t now uses the QuickCheck interface)

ebresafegaga avatar Sep 02 '22 14:09 ebresafegaga