amnh / PCG

𝙋𝙝𝙮𝙡𝙤𝙜𝙚𝙣𝙚𝙩𝙞𝙘 𝘾𝙤𝙢𝙥𝙤𝙣𝙚𝙣𝙩 𝙂𝙧𝙖𝙥𝙝 ⸺ Haskell program and libraries for general phylogenetic graph search
28 stars 1 forks source link

Update integration tests to access values in a well typed manner #84

Closed recursion-ninja closed 5 years ago

recursion-ninja commented 5 years ago

Currently, most of the integration tests parse a data file for the desired value and compare it against a known value. This parsing is subject to possible failures. It would be much better to use the SAVE() command in PCG to serialize out a save state of the program's current working state after the script has completed and then have the integration tests read in and deserialize the save state to the complete and working Haskell object at the end of the PCG script and then use accessors to query the "solution" object for the desired value(s) to compare against.

This will prevent issues regarding changes in output formats effecting the value parser(s) while simultaneously making accessing more values easier as we won't have to write new parsers for each desired value.

recursion-ninja commented 5 years ago

I encountered a strange runtime error while implementing this feature:

Invalid non-NFData closure (type 25087082) in Compact

@Boarders, do you have any idea how to diagnosis this. I'm assuming I need to add an NFData instance for one of the types in the GraphState, but I have no idea which one is type 25087082.

Could it be a problem that the executable pcg serialized the save state and the executable integration-tests deserialized the save state?

recursion-ninja commented 5 years ago

Maybe we need to use something like cereal instead?

recursion-ninja commented 5 years ago

@Boarders has merged this functionality into master using the binary library.