Skip to content

Commit 28cca6c

Browse files
author
Documenter.jl
committed
build based on 95009b2
1 parent debbe77 commit 28cca6c

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

previews/PR84/advanced/index.html

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
runtests(MyPackage, ARGS; testsuite)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Running 2 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
1717
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
1818
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
19-
<span class="sgr37">basic (1) │ 0.18 │ 0.00 │ 0.0 │ 5.67564.60</span>
20-
<span class="sgr37">advanced (2) │ 0.12 │ 0.00 │ 0.0 │ 5.86566.61</span>
19+
<span class="sgr37">advanced (1) │ 0.12 │ 0.00 │ 0.0 │ 5.86563.07</span>
20+
<span class="sgr37">basic (2) │ 0.17 │ 0.00 │ 0.0 │ 5.67565.08</span>
2121

2222
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
23-
Overall | <span class="sgr32"> 3 </span><span class="sgr36"> 3 </span>8.1s
23+
Overall | <span class="sgr32"> 3 </span><span class="sgr36"> 3 </span>7.9s
2424
<span class="sgr32"><span class="sgr1">SUCCESS</span></span></code></pre><h2 id="Filtering-Test-Files"><a class="docs-heading-anchor" href="#Filtering-Test-Files">Filtering Test Files</a><a id="Filtering-Test-Files-1"></a><a class="docs-heading-anchor-permalink" href="#Filtering-Test-Files" title="Permalink"></a></h2><p>You can also use <a href="../api/#ParallelTestRunner.find_tests"><code>find_tests</code></a> to automatically discover test files and then filter or modify them. This requires manually parsing arguments so that filtering is only applied when the user did not request specific tests to run:</p><pre><code class="language-julia hljs">using ParallelTestRunner
2525
using MyPackage
2626

@@ -40,7 +40,7 @@
4040
runtests(MyPackage, args; testsuite)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Running 1 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
4141
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
4242
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
43-
<span class="sgr37">basic (3) │ 0.18 │ 0.00 │ 0.0 │ 5.67 │ 597.96</span>
43+
<span class="sgr37">basic (3) │ 0.17 │ 0.00 │ 0.0 │ 5.67 │ 591.93</span>
4444

4545
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
4646
Overall | <span class="sgr32"> 1 </span><span class="sgr36"> 1 </span>4.0s
@@ -57,8 +57,8 @@
5757
runtests(MyPackage, ARGS; init_code)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Running 2 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
5858
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
5959
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
60-
<span class="sgr37">advanced (5) │ 0.19 │ 0.00 │ 0.0 │ 5.67 │ 604.03</span>
61-
<span class="sgr37">basic (4) │ 0.19 │ 0.00 │ 0.0 │ 5.67 │ 606.11</span>
60+
<span class="sgr37">advanced (4) │ 0.17 │ 0.00 │ 0.0 │ 5.67 │ 598.22</span>
61+
<span class="sgr37">basic (5) │ 0.17 │ 0.00 │ 0.0 │ 5.67 │ 600.26</span>
6262

6363
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
6464
Overall | <span class="sgr32"> 2 </span><span class="sgr36"> 2 </span>4.0s
@@ -92,9 +92,9 @@
9292
runtests(MyPackage, ARGS; test_worker, testsuite)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">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.
9393
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
9494
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
95-
<span class="sgr37">needs_threads (6) │ 0.11 │ 0.00 │ 0.0 │ 5.38 │ 628.62</span>
96-
<span class="sgr37">needs_env_var (7) │ 0.11 │ 0.00 │ 0.0 │ 5.38 │ 628.62</span>
97-
<span class="sgr37">normal_test (8) │ 0.12 │ 0.00 │ 0.0 │ 5.38 │ 630.70</span>
95+
<span class="sgr37">needs_env_var (6) │ 0.11 │ 0.00 │ 0.0 │ 5.38 │ 623.15</span>
96+
<span class="sgr37">needs_threads (7) │ 0.12 │ 0.00 │ 0.0 │ 5.38 │ 625.25</span>
97+
<span class="sgr37">normal_test (8) │ 0.11 │ 0.00 │ 0.0 │ 5.38 │ 623.15</span>
9898

9999
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
100100
Overall | <span class="sgr32"> 3 </span><span class="sgr36"> 3 </span>5.1s
@@ -113,19 +113,19 @@
113113
runtests(MyPackage, args)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Running 2 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
114114
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
115115
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
116-
<span class="sgr37">advanced (9) │ 0.18 │ 0.00 │ 0.0 │ 5.67 │ 654.71</span>
117-
<span class="sgr37">basic (10) │ 0.18 │ 0.00 │ 0.0 │ 5.67 │ 654.71</span>
116+
<span class="sgr37">advanced (9) │ 0.18 │ 0.00 │ 0.0 │ 5.67 │ 649.27</span>
117+
<span class="sgr37">basic (10) │ 0.18 │ 0.00 │ 0.0 │ 5.67 │ 649.27</span>
118118

119119
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
120120
Overall | <span class="sgr32"> 2 </span><span class="sgr36"> 2 </span>4.0s
121121
<span class="sgr32"><span class="sgr1">SUCCESS</span></span></code></pre><p>Custom flags are stored in the <code>custom</code> field of the <a href="../api/#ParallelTestRunner.ParsedArgs"><code>ParsedArgs</code></a> object, with values of <code>nothing</code> (not set) or <code>Some(value)</code> (set, with optional value).</p><h2 id="Interactive-use"><a class="docs-heading-anchor" href="#Interactive-use">Interactive use</a><a id="Interactive-use-1"></a><a class="docs-heading-anchor-permalink" href="#Interactive-use" title="Permalink"></a></h2><p>Arguments can also be passed via the standard <a href="https://pkgdocs.julialang.org/v1/api/#Pkg.test"><code>Pkg.test</code></a> interface for interactive control. For example, here is how we could run the subset of test files that start with the name <code>test_cool_feature</code> in i) verbose mode, and ii) with a specific number of Julia threads enabled:</p><pre><code class="language-bash hljs"># Start julia in an environment where `MyPackage.jl` is available
122122
julia --project</code></pre><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; using Pkg</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; # No need to start a fresh session to change threading
123123
Pkg.test(&quot;MyPackage&quot;; test_args=`--verbose advanced`, julia_args=`--threads=auto`);</code><code class="nohighlight hljs ansi" style="display:block;"><span class="sgr32"><span class="sgr1"> Testing</span></span> MyPackage
124-
<span class="sgr32"><span class="sgr1"> Status</span></span> `/tmp/jl_TPIqjF/Project.toml`
124+
<span class="sgr32"><span class="sgr1"> Status</span></span> `/tmp/jl_SWhsGi/Project.toml`
125125
<span class="sgr90">[0b48ad8b] </span>MyPackage v0.0.0 `~/work/ParallelTestRunner.jl/ParallelTestRunner.jl/docs/MyPackage`
126126
<span class="sgr90">[d3525ed8] </span>ParallelTestRunner v2.0.2 `~/work/ParallelTestRunner.jl/ParallelTestRunner.jl`
127127
<span class="sgr90">[8dfed614] </span>Test v1.11.0
128-
<span class="sgr32"><span class="sgr1"> Status</span></span> `/tmp/jl_TPIqjF/Manifest.toml`
128+
<span class="sgr32"><span class="sgr1"> Status</span></span> `/tmp/jl_SWhsGi/Manifest.toml`
129129
<span class="sgr90">[b5f81e59] </span>IOCapture v1.0.0
130130
<span class="sgr90">[36869731] </span>Malt v1.4.0 `https://github.com/giordano/Malt.jl.git#mg/worker-stdout-stderr`
131131
<span class="sgr90">[0b48ad8b] </span>MyPackage v0.0.0 `~/work/ParallelTestRunner.jl/ParallelTestRunner.jl/docs/MyPackage`
@@ -158,11 +158,11 @@
158158
Running 1 tests in parallel. If this is too many, specify the `--jobs=N` argument to the tests, or set the `JULIA_CPU_THREADS` environment variable.
159159
<span class="sgr37"> │ ──────────────── CPU ──────────────── │</span>
160160
<span class="sgr37">Test (Worker) │ Time (s) │ GC (s) │ GC % │ Alloc (MB) │ RSS (MB) │</span>
161-
<span class="sgr37">advanced (1) │</span><span class="sgr90"> started at 2026-01-19T17:16:47.153</span>
162-
<span class="sgr37">advanced (1) │ 0.17 │ 0.00 │ 0.0 │ 5.67 │ 420.38</span>
161+
<span class="sgr37">advanced (1) │</span><span class="sgr90"> started at 2026-01-19T17:40:24.508</span>
162+
<span class="sgr37">advanced (1) │ 0.17 │ 0.00 │ 0.0 │ 5.67 │ 417.18</span>
163163

164164
<span class="sgr1">Test Summary: | <span class="sgr32">Pass </span><span class="sgr36">Total </span>Time</span>
165-
Overall | <span class="sgr32"> 1 </span><span class="sgr36"> 1 </span>7.0s
165+
Overall | <span class="sgr32"> 1 </span><span class="sgr36"> 1 </span>6.9s
166166
advanced | <span class="sgr32"> 1 </span><span class="sgr36"> 1 </span>0.1s
167167
<span class="sgr32"><span class="sgr1">SUCCESS</span></span>
168168
<span class="sgr32"><span class="sgr1"> Testing</span></span> MyPackage tests passed</code></pre><p>Alternatively, arguments can be passed directly from the command line with a shell alias like the one below:</p><pre><code class="language-julia-repl hljs">jltest --threads=auto -- --verbose test_cool_feature</code></pre><p>Shell alias:</p><pre><code class="language-bash hljs">function jltest {
@@ -178,4 +178,4 @@
178178
}</code></pre><h2 id="Best-Practices"><a class="docs-heading-anchor" href="#Best-Practices">Best Practices</a><a id="Best-Practices-1"></a><a class="docs-heading-anchor-permalink" href="#Best-Practices" title="Permalink"></a></h2><ol><li><p><strong>Keep tests isolated</strong>: Each test file runs in its own module, so avoid relying on global state between tests.</p></li><li><p><strong>Use <code>init_code</code> for common setup</strong>: Instead of duplicating setup code in each test file, use <code>init_code</code> to share common initialization.</p></li><li><p><strong>Filter tests appropriately</strong>: Use <a href="../api/#ParallelTestRunner.filter_tests!"><code>filter_tests!</code></a> to respect user-specified test filters while allowing additional programmatic filtering.</p></li><li><p><strong>Handle platform differences</strong>: Use conditional logic in your test suite setup to handle platform-specific tests:</p><pre><code class="language-julia hljs">testsuite = find_tests(pwd())
179179
if Sys.iswindows()
180180
delete!(testsuite, &quot;unix_specific_test&quot;)
181-
end</code></pre></li><li><p><strong>Load balance the test files</strong>: <code>ParallelTestRunner</code> runs the tests files in parallel, ideally all test files should run for <em>roughly</em> the same time for better performance. Having few long-running test files and other short-running ones hinders scalability.</p></li><li><p><strong>Use custom workers sparingly</strong>: Custom workers add overhead. Only use them when tests genuinely require different configurations.</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.16.1 on <span class="colophon-date" title="Monday 19 January 2026 17:17">Monday 19 January 2026</span>. Using Julia version 1.12.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
181+
end</code></pre></li><li><p><strong>Load balance the test files</strong>: <code>ParallelTestRunner</code> runs the tests files in parallel, ideally all test files should run for <em>roughly</em> the same time for better performance. Having few long-running test files and other short-running ones hinders scalability.</p></li><li><p><strong>Use custom workers sparingly</strong>: Custom workers add overhead. Only use them when tests genuinely require different configurations.</p></li></ol></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../api/">API Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.16.1 on <span class="colophon-date" title="Monday 19 January 2026 17:40">Monday 19 January 2026</span>. Using Julia version 1.12.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)