Skip to content

test: Check hugr json serializations against the schema (again) #2216

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aborgna-q
Copy link
Collaborator

Removed in #2186

@aborgna-q aborgna-q requested a review from acl-cqc May 14, 2025 13:12
@aborgna-q aborgna-q requested a review from a team as a code owner May 14, 2025 13:12
@@ -10,7 +10,7 @@ setup:

# Run the pre-commit checks.
check:
uv run pre-commit run --all-files
HUGR_TEST_SCHEMA=1 uv run pre-commit run --all-files
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels quite heavyweight for a pre-commit, but I don't really object

Copy link
Collaborator Author

@aborgna-q aborgna-q May 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the rule ran on just check. pre-commit has its own config that doesn't set the envvar.

Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aborgna-q - Lemme just check why the roundtrip schema validation wasn't catching my change, because this looks like the same check...

Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.01%. Comparing base (0280eb2) to head (e90dc84).

Files with missing lines Patch % Lines
hugr-core/src/envelope/package_json.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2216   +/-   ##
=======================================
  Coverage   82.00%   82.01%           
=======================================
  Files         230      230           
  Lines       40940    40951   +11     
  Branches    37041    37052   +11     
=======================================
+ Hits        33574    33584   +10     
- Misses       5398     5399    +1     
  Partials     1968     1968           
Flag Coverage Δ
python 85.63% <ø> (ø)
rust 81.62% <90.90%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acl-cqc
Copy link
Contributor

acl-cqc commented May 14, 2025

Yeah, so see https://github.com/CQCL/hugr/actions/runs/15024222682, passing on the last commit (20bd6a7) on branch acl/schema_test. So whilst I am minded to approve this PR as is (that is - this PR doesn't look like it introduces too much overhead to me!), clearly schema validation is not doing what I think it should...

@aborgna-q
Copy link
Collaborator Author

So whilst I am minded to approve this PR as is (that is - this PR doesn't look like it introduces too much overhead to me!)

So, should we merge it?

@aborgna-q aborgna-q requested a review from acl-cqc May 20, 2025 09:45
@acl-cqc
Copy link
Contributor

acl-cqc commented May 21, 2025

So, should we merge it?

I think we should understand why these kind of checks don't catch the malformed json's mentioned above; if these aren't schema violations, why not / what are they?

Thinking we have schema checks when actually they don't catch what look to me like schema errors, could well be worse than knowing we don't have schema checks....

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.

2 participants