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_logs crashes when it fails #63

Closed
dpinol opened this issue Dec 17, 2024 · 4 comments
Closed

@test_logs crashes when it fails #63

dpinol opened this issue Dec 17, 2024 · 4 comments

Comments

@dpinol
Copy link

dpinol commented Dec 17, 2024

How to reproduce

@test_logs (:warn, "msg") nothing
  MethodError: no method matching record(::Jive.JiveTestSet, ::Test.LogTestFailure)
  
  Closest candidates are:
    record(::Test.ContextTestSet, ::Any)
     @ Test /opt/julia/julia-1.10.5/share/julia/stdlib/v1.10/Test/src/Test.jl:1025
    record(::Test.FallbackTestSet, ::Test.LogTestFailure)
     @ Test /opt/julia/julia-1.10.5/share/julia/stdlib/v1.10/Test/src/logging.jl:157
    record(::Test.DefaultTestSet, ::Test.LogTestFailure)
     @ Test /opt/julia/julia-1.10.5/share/julia/stdlib/v1.10/Test/src/logging.jl:162
    ...

workaround

using Jive
function Test.record(ts::Jive.JiveTestSet, t::Test.LogTestFailure)
    return Test.record(ts.default, t)
end
@wookay
Copy link
Owner

wookay commented Dec 18, 2024

hmm.. I could not reproduce this error.

~/.julia/dev/Jive/test/jive/issues $ cat issue63.jl
using Jive
using Test

@test_logs (:warn, "msg") nothing

~/.julia/dev/Jive/test/jive/issues $ julia issue63.jl
Log Test Failed at ~/.julia/dev/Jive/test/jive/issues/issue63.jl:4
  Expression: nothing
  Log Pattern: (:warn, "msg")
  Captured Logs:

ERROR: LoadError: There was an error during testing

@dpinol
Copy link
Author

dpinol commented Dec 20, 2024

You need to call Jive's runtests
JiveLog.zip

@wookay wookay closed this as completed in 462693c Dec 21, 2024
@wookay wookay reopened this Dec 21, 2024
@wookay
Copy link
Owner

wookay commented Dec 21, 2024

thanks!

@dpinol
Copy link
Author

dpinol commented Dec 26, 2024

thanks for the fix & release!

@dpinol dpinol closed this as completed Dec 26, 2024
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

No branches or pull requests

2 participants