Skip to content

Improve Avro unit tests #54

@bartkl

Description

@bartkl

Issues:

  • When testing message serialization/deserialization, I haven't found a way to let Lancaster deserialize JSON messages, so currently the testdata is simply in EDN form so I can compare immediately. Maybe if I read my JSON file in binary mode as bytes array I can get it to work with l/deserialize, that's worth looking into. Anyways, the thing that needs leveraging is the mapping of JSON field names to the EDN keywords, like `"fromAtoC" -> :from-ato-c'.
  • In some test cases it's not necessary to write to file, and simply using the Lancaster schema object immediately makes more sense.
    • Note: core.clj is getting cluttered a bit with high-level user functions that might need to go in some separate namespace at some point (like store-in-db and generate-avro-schema).
  • More actual unit tests need to be written anyways...
  • Lots of repetition in test logic: use abstractions and fixtures would clean up a lot.
    • In fact, currently when an assertion fails the file-deletion clean-up doesn't even occur, which is technically a bug in the tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    avroAvro schemaqualityImproving the quality of code and documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions