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

feat: Add schema validation tests #5654

Merged
merged 6 commits into from
Aug 2, 2023

Conversation

Leo10Gama
Copy link
Member

Why is this change necessary?

To ensure the generated schema is correct, we need to test it against various config files. This will ensure that tests that should validate against the schema will validate, while tests that shouldn't validate against the schema won't.

How does it address the issue?

A new test file, test_schema_validation.py has been created to validate various config files against the generated schema. In addition, a testdata folder has been added, with various hand-written config files to test each command, as well as prevent invalid schemas.

What side effects does this change have?

New tests have been added, to test that config files will and won't validate against the schema.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

  • Add input/output type hints to new functions/methods
  • Write design document if needed (Do I need to write a design document?)
  • Write/update unit tests
  • Write/update integration tests
  • Write/update functional tests if needed
  • make pr passes
  • make update-reproducible-reqs if dependencies were changed
  • Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Leo10Gama Leo10Gama requested a review from a team as a code owner July 31, 2023 18:26
@github-actions github-actions bot added area/schema JSON schema file pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Jul 31, 2023
tests/unit/schema/test_schema_validation.py Outdated Show resolved Hide resolved
@lucashuy lucashuy enabled auto-merge (squash) August 2, 2023 16:34
@lucashuy lucashuy merged commit 4beb300 into aws:feat/json-schema Aug 2, 2023
73 checks passed
@Leo10Gama Leo10Gama deleted the validation-tests branch August 2, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/schema JSON schema file pr/internal stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants