Skip to content

Conversation

@icweaver
Copy link
Member

@icweaver icweaver commented Oct 20, 2025

Following the lead here: tkemmer/ImplicitArrays.jl#11

Can maybe revisit after julia-vscode/TestItemRunner.jl#113 is resolved

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.70%. Comparing base (d575f2a) to head (e797e0b).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   94.43%   94.70%   +0.26%     
==========================================
  Files          11       11              
  Lines         935      736     -199     
==========================================
- Hits          883      697     -186     
+ Misses         52       39      -13     
Flag Coverage Δ
unittests 94.70% <ø> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@giordano
Copy link
Member

This is fun

@giordano
Copy link
Member

Side note, looks like the docs workflow would benefit a lot from caching

@icweaver
Copy link
Member Author

Oh no, good fun or bad fun? 😂

@icweaver icweaver marked this pull request as draft October 20, 2025 22:54
@giordano
Copy link
Member

Good fun, I'm surprised by people discovering this package before any public announcement 😅

@icweaver
Copy link
Member Author

haha, for sure. I like it a lot! I stumbled on it after following the breadcrumbs from Thomas' activity here julia-vscode/TestItemRunner.jl#113

@icweaver icweaver marked this pull request as ready for review October 21, 2025 21:00
@icweaver
Copy link
Member Author

icweaver commented Oct 21, 2025

Hi @cgarling @abhro,

I think I've had a change of heart with using TestItemRunner since discovering ParallelTestRunner. It combines the nice filtering capabilities of TestItems with the drop-in integration with Tests, and it is compatible with Julia v1.13.

I added some brief usage examples to the contributor docs for your review. Are there any reservations about switching over to this newer test framework?

README.md Outdated
const DATA_DIR = joinpath(@__DIR__, "data")
end
julia> runtests(Photometry, ["--verbose"]; init_code, test_filter = test -> occursin("aperture", test))
Copy link
Member

Choose a reason for hiding this comment

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

Why not using Pkg.test? You don't need to do all the above.

Copy link
Member Author

@icweaver icweaver Oct 21, 2025

Choose a reason for hiding this comment

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

Right, that's shown in the Pkg.test() example right above that one, no?

Is there a way to pass filters to Pkg.test directly?

Copy link
Member

@giordano giordano Oct 21, 2025

Choose a reason for hiding this comment

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

Yes, if you don't override the test arguments

diff --git a/test/runtests.jl b/test/runtests.jl
index 6858225..fce2a4e 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -10,4 +10,4 @@ const init_code = quote
 end
 
 
-runtests(Photometry, ["--verbose"]; init_code)
+runtests(Photometry, Base.ARGS; init_code)

Then you can do things like

julia> using Pkg

julia> Pkg.test("Photometry"; test_args=`--list`);
# ...
     Testing Running tests...
Available tests:
 - aperture/circular
 - aperture/elliptical
 - aperture/overlap
 - aperture/photometry
 - aperture/plotting
 - aperture/rectangle
 - backgroud/background
 - backgroud/estimators
 - backgroud/interpolators
 - detection/detection
     Testing Photometry tests passed

julia> Pkg.test("Photometry"; test_args=`aperture`);
# ...
     Testing Running tests...
Running 3 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
                          │          │ ──────────────── CPU ──────────────── │
Test             (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │
aperture/plotting     (3) │     4.96 │   0.40 │  8.0 │     710.77 │   719.78 │
aperture/overlap      (2) │     6.76 │   0.40 │  6.0 │     853.93 │   729.97 │
aperture/circular     (3) │     1.19 │   0.00 │  0.0 │     135.66 │   738.62 │
aperture/elliptical   (2) │     0.47 │   0.00 │  0.0 │      68.41 │   733.27 │
aperture/rectangle    (3) │     0.97 │   0.00 │  0.0 │     112.31 │   744.61 │
aperture/photometry   (1) │    13.30 │   0.64 │  4.8 │    2595.35 │   847.80 │

Test Summary: | Pass  Total   Time
  Overall     | 9478   9478  17.5s
    SUCCESS
     Testing Photometry tests passed

julia> Pkg.test("Photometry"; test_args=`--verbose aperture`);
# ...
     Testing Running tests...
Running 3 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
                          │          │ ──────────────── CPU ──────────────── │
Test             (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │
aperture/photometry   (1) │        started at 2025-10-21T23:46:23.085
aperture/overlap      (2) │        started at 2025-10-21T23:46:23.094
aperture/plotting     (3) │        started at 2025-10-21T23:46:23.094
aperture/plotting     (3) │     5.02 │   0.39 │  7.8 │     710.82 │   699.16 │
aperture/circular     (3) │        started at 2025-10-21T23:46:30.214
aperture/overlap      (2) │     6.85 │   0.40 │  5.9 │     853.93 │   693.41 │
aperture/elliptical   (2) │        started at 2025-10-21T23:46:31.916
aperture/circular     (3) │     1.18 │   0.00 │  0.0 │     135.66 │   699.16 │
aperture/rectangle    (3) │        started at 2025-10-21T23:46:32.068
aperture/elliptical   (2) │     0.47 │   0.00 │  0.0 │      68.40 │   693.41 │
aperture/rectangle    (3) │     0.97 │   0.00 │  0.0 │     112.31 │   699.16 │
aperture/photometry   (1) │    13.39 │   0.63 │  4.7 │    2595.44 │   774.45 │

Test Summary:           | Pass  Total   Time
  Overall               | 9478   9478  17.4s
    aperture/plotting   |   27     27   5.0s
    aperture/overlap    | 9226   9226   6.8s
    aperture/circular   |   21     21   1.2s
    aperture/elliptical |   20     20   0.5s
    aperture/rectangle  |   12     12   1.0s
    aperture/photometry |  172    172  13.4s
    SUCCESS
     Testing Photometry tests passed

Copy link
Member

Choose a reason for hiding this comment

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

If you really wanted to force verbose tests you could use push!(copy(Base.ARGS), "--verbose"), but ParallelTestRunner.runtests is supposed to take command line arguments via Base.ARGS, if you override that you miss a good chunk of the interface

Copy link
Member

Choose a reason for hiding this comment

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

Oh, and you can also do things like

Pkg.test("Photometry"; test_args=`aperture`, julia_args=`--threads=auto`)

to pass Julia arguments to the tests, possibly different from the arguments of the current session, so you don't need to restart julia with --threads=auto just to change that for the tests.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, sick! Thanks for giving me a walk-through, adding this now

Copy link
Member

@giordano giordano Oct 21, 2025

Choose a reason for hiding this comment

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

If you think ParallelTestRunner documentation could be improved to make that clearer, please do submit a PR! And then you could also add this package to https://github.com/JuliaTesting/ParallelTestRunner.jl/blob/main/README.md#packages-using-paralleltestrunnerjl 😁

Copy link
Member

Choose a reason for hiding this comment

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

If you think ParallelTestRunner documentation could be improved to make that clearer

Maybe it needs a section for those using the tests, in addition to the one about setting them up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Just opened JuliaTesting/ParallelTestRunner.jl#60 to discuss

Co-authored-by: Mosè Giordano <765740+giordano@users.noreply.github.com>
Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

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

For what is worth, this looks good to me. Tests on CI are ~20 seconds (out of ~60-70) faster than on main, not a massive improvement (could be better with more even load of the tests across the files, one is sensibly larger than all the others), but I think it's good nevertheless

@icweaver
Copy link
Member Author

Interesting, thanks for taking a look at the timings!

@abhro
Copy link
Member

abhro commented Oct 22, 2025

I added some brief usage examples to the contributor docs for your review. Are there any reservations about switching over to this newer test framework?

Other than the single comment about test variable PARAMS (which was just moved, not even a new change), it looks good to me! Thank you very much for your investment in this project!!

@icweaver
Copy link
Member Author

Great, thanks for the review! @cgarling does this look good to merge to you?

@icweaver
Copy link
Member Author

icweaver commented Oct 24, 2025

Sorry for the late additions. I thought it would be good to tighten up the imports a little. Would probably be good to do a pass with ExplicitImports.jl after this PR is merged

@cgarling
Copy link
Member

I don't have time to do a full review right now (sorry) but I did a quick skim and it looks good. Also ParallelTestRunner seems cool

@icweaver
Copy link
Member Author

Thanks! No worries, totally understand. Fortune to have Abhro and Mosè's eyes on this too. Will go ahead and merge

@icweaver icweaver merged commit a2aa1c9 into main Oct 24, 2025
13 checks passed
@icweaver icweaver deleted the parallel-test-runner branch October 24, 2025 18:39
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.

4 participants