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

Switch tests to use TestItemRunner.jl #75

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

thofma
Copy link
Contributor

@thofma thofma commented Aug 4, 2024

Closes #72.

Minor caveat: In vscode, you cannot rerun the whole test suite. Apparently JET overloads all methods for JET purposes, leaving the whole test "environment" in a bad state (which gets reused once you rerun the tests).

@thofma
Copy link
Contributor Author

thofma commented Aug 4, 2024

The aforementioned problems are also visible in the JET = true test: https://github.com/QuantumSavory/QuantumSymbolics.jl/actions/runs/10235345985/job/28316061643?pr=75.

Here is what goes wrong: After JET.report_package(...) one has the following:

julia> JET.report_package(QuantumSymbolics);
[...]

julia> @op A; @op B;

julia> QuantumSymbolics.prefactorscalings([2*A B])
(1, Any[2A, B])

julia> 2*A isa SScaled
false

julia> typeof(2*A)
SScaledOperator (alias for Main.var"##JETVirtualModule#227".QuantumSymbolics.SScaled{QuantumInterface.AbstractOperator})

Without JET:

julia> @op A; @op B;

julia> QuantumSymbolics.prefactorscalings([2*A B])
(2, Any[A, B])

julia> 2*A isa SScaled
true

julia> typeof(2*A)
SScaledOperator (alias for SScaled{AbstractOperator})

This type mismatch 2*A isa SScaled == false messes up the prefactorscalings method.

@thofma
Copy link
Contributor Author

thofma commented Aug 4, 2024

I worked around it by running the JET test last.

Copy link

codecov bot commented Aug 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.11%. Comparing base (d3226fc) to head (47b8161).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
+ Coverage   73.88%   74.11%   +0.23%     
==========================================
  Files          18       18              
  Lines         804      823      +19     
==========================================
+ Hits          594      610      +16     
- Misses        210      213       +3     

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

@Krastanov Krastanov merged commit f291b77 into QuantumSavory:main Aug 5, 2024
11 of 15 checks passed
@Krastanov
Copy link
Member

Thank you! Added to the list :D

@thofma thofma deleted the th/test branch August 5, 2024 18:37
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.

# Move the test runner to use TestItems.jl [$200]
2 participants