Skip to content

Tests for a data dictionary #107

@delocalizer

Description

@delocalizer

What I'd like to do

I'd like to start with a python object or single JSON document that potentially represents a valid input for a Gen3 dictionary used to create db tables etc — something like what is set in the DataDictionary.schema attribute, or output by dump_schemas_from_dir — and check whether it conforms to all the required business rules for such a thing. For example, that the node schema elements conform to the metaschema, that links elements exist and point to valid nodes, that required ubiquitous fields exist, etc — the sorts of things that look to be tested for here in schema_test.py and tests/ modules.

Problems I'm having

  1. I can't get the tests to work or find instructions on how to run them in a generic dev environment.
  2. Current tests for dictionary business rules seem strongly coupled to the process of creating the dictionary in a specific way, depending on specific files existing in specific directories, and the initialization of the dictionary module. I don't see an easy way to test a data dictionary object or document that I supply 'as-is'. This constrains upstream data modelling steps to be based on prior examples with a particular filesystem layout. To my mind, the tests for the dictionary business rules should run on an object that is as near as possible to 'input ready' for the consuming services.
  3. It's not real clear to me what are the rules for a valid Gen3 data dictionary. Much of it seems implicit in prior art, i.e. "make it look like this because this works". It would be fantastic to have the definitive set of explicit tests that state what is expected, and at the same time where each requirement comes from (why does the id need to be a UUID? what service needs valid links to create connections between nodes? why must there be a program and a project schema?) so that the tests themselves serve as technical documentation. The dictionary is at the heart of everything, and this seems important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions