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

Enh schema enforcer #243

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Enh schema enforcer #243

wants to merge 2 commits into from

Conversation

asmacdo
Copy link
Member

@asmacdo asmacdo commented Feb 19, 2025

This is built on #241, originally to determine the list of fields that are filterable, but that is a secondary bonus, so I've separated this work into a separate PR.

By running duct, and flattening the output info.json we can guarantee that the info.json field list has not changed. When it does, this test will fail, and can help us to remember to bump the schema version.

Additionally, this tests that LS_FIELD_CHOICES is accurate and contains all the field choices (currently we are missing a couple)

  • Add missing fields to LS_FIELD_CHOICES

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.12%. Comparing base (b7daaec) to head (75003f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #243   +/-   ##
=======================================
  Coverage   94.12%   94.12%           
=======================================
  Files           5        5           
  Lines         749      749           
  Branches       95       95           
=======================================
  Hits          705      705           
  Misses         26       26           
  Partials       18       18           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yarikoptic
Copy link
Member

per conversation -- no need for overcomplicating, just make a test to compare to a list of specific values (being sorted)

@asmacdo asmacdo force-pushed the enh-schema-enforcer branch from 7e0b457 to 722c5d8 Compare February 21, 2025 21:16
Adds a test that both:
  - ensures that LS_FIELD_CHOICES represents all info.json fields
  - ensure that info.json fields have not changed (which would require a
    version bump, and a change to the field transformations)
there was no order previously, so might as well be alphabetized
@asmacdo asmacdo force-pushed the enh-schema-enforcer branch from 722c5d8 to 75003f4 Compare February 21, 2025 21:17
@asmacdo asmacdo added the semver-tests Add or improve existing tests label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-tests Add or improve existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants