Skip to content

Add a specification property to test cases + tests #699

Open
@Julian

Description

@Julian

There isn't a fixed spot in tests right now which indicates which portion, section, or text of the specification it covers. The suite's main purpose is of course to faithfully represent the specification, so essentially all tests should have some direct basis in the specification, but we leave that for someone interested to have to re-locate, even though this work should have been done before adding each individual test (by at least 2 people presumably -- the test author as well as the reviewer). Right now we occasionally use comments to indicate this information, but having a specific spot for it could open up possibilities, but we should earmark a spot in each test where we include this information.

Considerations:

  • Not all portions of the specification are "deeply structured" -- meaning the best we may be able to say about a test is "it's in section 8.2" but that may have text which covers 20 or more tests because it is intricate. It seems here we should simply do the best we can, perhaps filing issues upstream in the spec when encountering particularly deficient structure.
  • The specification, even within a specific version, is occasionally republished. This may cause section information to go out of date.
  • There are other specifications besides the core JSON Schema specification which we reference. While historically we tried to stay away from becoming a full test suite for specifications beyond JSON Schema (even if JSON Schema links or relies on them), there are places where we indeed test lots of edge cases (e.g. leap second tests). We should choose some mechanism which allows us to represent this information as well -- i.e. for such tests, ideally we'd represent both: 1) where in the JSON Schema specification does it say to follow some other specification or RFC, 2) where in that other RFC is this behavior specified
  • Think about what the schema of this property should look like -- more structured is better, as it will allow for "unforeseen" uses -- e.g. us being able to calculate what fraction of the specification we cover with the suite itself.
  • The test suite schema will need to be modified to include this key. It will likely need to be and stay optional, but we should attempt to add it everywhere we can.
  • Please do not send a massive PR doing this for the whole suite, but rather send small, perhaps single file PRs to add it to tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn enhancement to the tooling or structure of the suite (as opposed to a new test).good first issueAn issue that is a good candidate for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions