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

test: cargo build validator in CI #468

Merged
merged 2 commits into from
Sep 9, 2024
Merged

test: cargo build validator in CI #468

merged 2 commits into from
Sep 9, 2024

Conversation

acl-cqc
Copy link
Contributor

@acl-cqc acl-cqc commented Sep 9, 2024

Many hugr-building tests are showing up as s == skipped after #455. We need to cargo build the validator first.

Also "fix" (perhaps hack) run_int_fn to extract the first module Hugr from the Package coming back from compilation.

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.94%. Comparing base (3b778c3) to head (f5b4909).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
- Coverage   92.05%   91.94%   -0.11%     
==========================================
  Files          55       58       +3     
  Lines        5714     5849     +135     
==========================================
+ Hits         5260     5378     +118     
- Misses        454      471      +17     

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

@acl-cqc acl-cqc changed the title tests: cargo build validator in CI test: cargo build validator in CI Sep 9, 2024
@acl-cqc acl-cqc force-pushed the acl/ci_build_validator branch from 78dd8a2 to 6cf790d Compare September 9, 2024 14:03
@acl-cqc acl-cqc requested a review from mark-koch September 9, 2024 14:33
@acl-cqc acl-cqc marked this pull request as ready for review September 9, 2024 14:33
@acl-cqc acl-cqc requested a review from a team as a code owner September 9, 2024 14:33
Copy link
Collaborator

@mark-koch mark-koch left a comment

Choose a reason for hiding this comment

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

Thanks!

I had to fix run_int_fn somehow to cope with that it now receives a Package not a Hugr. However, this is very much not a complete fix - perhaps it is even, dare I say it, a hack - but I guess one might argue it works fine for the kinds of function for which we expect run_int_fn to work anyway.

Yes, I think this is fine for now

We should probably have an issue for this, nonetheless.

Feel free to create one 👍

@acl-cqc acl-cqc enabled auto-merge September 9, 2024 15:18
@acl-cqc acl-cqc added this pull request to the merge queue Sep 9, 2024
Merged via the queue into main with commit 71340d2 Sep 9, 2024
5 checks passed
@acl-cqc acl-cqc deleted the acl/ci_build_validator branch September 9, 2024 15:22
@acl-cqc
Copy link
Contributor Author

acl-cqc commented Sep 9, 2024

We should probably have an issue for this, nonetheless.

Feel free to create one 👍

I think I reasoned that anyone wanting run_int_fn to do anything else....would encounter the same problem, and have to deal with it then. run_int_fn already has no docs of what it expects/contracts to do...

However, the bigger issue that playing around here reveals - is that the type annotations here (i.e. in tests/) are not checked; we never run mypy. So the only way a type annotation results in an error is at execution (e.g. pytest) time, when an annotation using a type that doesn't exist, fails to load the type. Do we plan to enable them? I guess not, since a lot of test code is @guppy ?
(If so, we could provide a custom Protocol for the return value of the run_int_fn fixture that would have detected this problem, say.)

github-merge-queue bot pushed a commit that referenced this pull request Sep 16, 2024
pytest previously skipped the validation tests if the validator was not
built, leading to the situation in #468 where many tests were
accidentally skipped in CI.

Instead, fail the tests if the validator is not installed, but allow
`pytest --no_validation` to skip them instead.

The possibility of doing similar for execution tests (somewhat-silently
skipped if `execute-llvm` isn't installed) is left for a later PR.

---------

Co-authored-by: Kartik Singhal <[email protected]>
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.

3 participants