Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup test harness for JSON Schemas #49

Merged
merged 2 commits into from
Jan 4, 2024
Merged

Setup test harness for JSON Schemas #49

merged 2 commits into from
Jan 4, 2024

Conversation

gnidan
Copy link
Member

@gnidan gnidan commented Dec 22, 2023

  • Create tests/ directory in repo root, containing a Yarn package for writing tests in TypeScript via ts-jest

  • Use @hyperjump/json-schema for its draft 2020-12 support and schema validation logic

  • Test that all schemas are valid

  • Test that all example values provided by schema definitions are valid according to their definition

  • Initialize mapping of which schema definitions extend which others

  • Test that all example values provided by schema definitions that extend other schemas are valid according to their base schema

  • Hook up tests to CI

... to serve as a minimally-necessary schema for all type
representations, to be extended by more-specific subschemas for known
kinds of types.

Specifically:

- Define formal JSON Schema in YAML
- Add "Type schemas" section to specification site
  - Include overview page to describe how type schemas are organized
  - Include placeholder page for to-be-written canonical type schema

- Add page to Type schemas section to informally specify
  ethdebug/format/type/base
  - Introduce purpose of this schema and how it fits more broadly
  - Explain key concepts defined by this schema
  - Represent full base schema via interactive nested React components
  - Provide example (non-canonical) schema extensions for a few types
- Create tests/ directory in repo root, containing a Yarn package for
  writing tests in TypeScript via ts-jest

- Use @hyperjump/json-schema for its draft 2020-12 support and schema
  validation logic

- Test that all schemas are valid

- Test that all example values provided by schema definitions are valid
  according to their definition

- Initialize mapping of which schema definitions extend which others

- Test that all example values provided by schema definitions that
  extend other schemas are valid according to their base schema

- Hook up tests to CI
Base automatically changed from base-type-schema to main January 4, 2024 23:29
@gnidan
Copy link
Member Author

gnidan commented Jan 4, 2024

Merging this with the plan to seek review at a future milestone

@gnidan gnidan merged commit ac0d66a into main Jan 4, 2024
2 checks passed
@gnidan gnidan deleted the schema-tests branch January 4, 2024 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant