mabarnes / moment_kinetics

Other
2 stars 4 forks source link

Running test prints long output that seems like it should be suppressed #212

Open LucasMontoya4 opened 5 months ago

LucasMontoya4 commented 5 months ago

I just cloned the master and set it up on my laptop for a clean start, and running the tests seems to do everything in working order, including giving the expected output

Test Summary:         |   Pass  Broken   Total     Time
moment_kinetics tests | 118503       2  118505  6m23.8s

However, after this line (which used not to happen) is a long printout of lists, which starts with

Test.DefaultTestSet("moment_kinetics tests", Any[Test.DefaultTestSet("calculus", Any[Test.DefaultTestSet("fundamental theorem of calculus", Any[Test.DefaultTestSet("finite_difference 5 1", Any[]...

and so on. Is this output meant to be suppressed somewhere?

johnomotani commented 4 months ago

Yeah, I've noticed the same thing - I think what has happened is that Test.jl returns this Test.DefaultTestSet struct so that you can (if you wanted to) query it for more information than just what was printed out to the terminal, and then Julia prints it by default (when you run the tests from the REPL). I don't know why it didn't get printed before - maybe Test.jl didn't return the struct, or hadn't defined a method to print it, or Julia's 'print a generic struct' functionality got 'upgraded' so that it now prints stuff where it didn't before.

We might be able to modify the runtest() functions in the tests so that they all end with return nothing. On the other hand maybe these Test.DefaultTestSet things could be useful at some point. The workaround is to put a semicolon after the command in the REPL, e.g.

julia> include("moment_kinetics/test/runtests.jl");

I always forget to do that and have to scroll up past the annoying output, but I think it's good enough to not need to change our test functions.