-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
bring back testset printing #20221
bring back testset printing #20221
Conversation
actually this fails to print the testset when there is a failure, will update |
1768324
to
07e028b
Compare
done |
How does this handle nested testsets? In 0.5, only top-level testsets were printed. |
Like on 0.5. julia> @testset "set" begin
# write your own tests here
@test 1 == 1
@testset "sesst" begin
@test 1 == 1
end
end
Test Summary: | Pass Total
set | 2 2 |
@@ -62,7 +62,7 @@ cd(dirname(@__FILE__)) do | |||
test = shift!(tests) | |||
local resp | |||
try | |||
resp = remotecall_fetch(runtests, p, test) | |||
resp = remotecall_fetch((t) -> (Base.Test.DISABLE_TESTSET_PRINTING[] = true; runtests(t)), p, test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do in the runtests function so it also applies to the node 1 tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea
double negatives are confusing, would be better to call it enable and switch the sense |
updated to put the disabling in In this case I think that the negative is warranted since we are explicitly disabling the printing. |
Disabling printing would be done by setting enable to false. More direct than enabling printing by setting disable to false. We've preferred this same direction in command line arguments and elsewhere. Whatever the default is, don't flip the sense of boolean options. |
This is better? |
the setter function isn't really necessary, it can be a ref, just that if it's a boolean then the sense should be enable=true, disable=false |
OK but this is like |
@@ -1,7 +1,7 @@ | |||
# This file is a part of Julia. License is MIT: http://julialang.org/license | |||
|
|||
function runtests(name, isolate=true) | |||
Base.Test.DISABLE_TESTSET_PRINTING[] = true | |||
Base.Test.testset_print_enable(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this turn off testset display for everyone else after having been run once? should restore past value when done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only called from runtests.jl
which spawn this in a new process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That won't necessarily be the case if some form of #19567 happens. It's a global-state trap, best to avoid leaving it hiding for anyone who wants to refactor this to get surprised by later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/JuliaLang/julia/pull/20221/files?w=1 This is not intended to be a public api where you can disable and enable at will. Right now it is like 0.5 with an escape hatch for base to disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then why did you make a setter function for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner imo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary if it's called in exactly one place and not intended to be ever touched by anyone else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case some form of #19567 happens then it is already there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're anticipating it to be used in the future, then manage it as if someone may have been setting it - save its actual past value and restore it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok done
9fa34bc
to
48fcf2e
Compare
48fcf2e
to
2ecdcf3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm as long as it doesn't cause any issues on CI
Should restore things like they were on 0.5 while keeping things like they are for Base tests (no testset printing).
Review with https://github.com/JuliaLang/julia/pull/20221/files?w=1