Skip to content

Commit

Permalink
Deployed a7032d0 with MkDocs version: 1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed May 24, 2024
1 parent 5cc5ea7 commit 8200037
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
11 changes: 11 additions & 0 deletions docs/cli/test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,15 @@
</ul>
</nav>

</li>

<li class="md-nav__item">
<a href="#-filter-types" class="md-nav__link">
<span class="md-ellipsis">
--filter &lt;types&gt;
</span>
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -1511,6 +1520,8 @@ <h4 id="-csv-filename"><code>--csv &lt;filename&gt;</code></h4>
<p>Writes test results in csv file.</p>
<h4 id="-ci"><code>--ci</code></h4>
<p>By default,nf-test automatically stores a new snapshot. When CI mode is activated, nf-test will fail the test instead of storing the snapshot automatically.</p>
<h3 id="-filter-types"><code>--filter &lt;types&gt;</code></h3>
<p>Filter test cases by specified types (e.g., module, pipeline, workflow or function). Multiple types can be separated by commas.</p>
<h3 id="optimizing-test-execution">Optimizing Test Execution</h3>
<h4 id="-related-tests-files"><code>--related-tests &lt;files&gt;</code></h4>
<p>Finds and executes all related tests for the provided .nf or nf.test files. Multiple files can be provided space separated.</p>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions tutorials/github-actions/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1230,15 +1230,15 @@ <h2 id="step-1-running-nf-test">Step 1: Running nf-test</h2>
<span class="w"> </span><span class="no">sudo mv nf-test /usr/local/bin/</span>

<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run Tests</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test --ci</span>
</code></pre></div>
<h3 id="explanation">Explanation:</h3>
<ol>
<li><strong>Checkout</strong>: Uses the <code>actions/checkout@v2</code> action to check out the repository.</li>
<li><strong>Set up JDK 11</strong>: Uses the <code>actions/setup-java@v2</code> action to set up Java Development Kit version 11.</li>
<li><strong>Setup Nextflow</strong>: Uses the <code>nf-core/setup-nextflow@v1</code> action to install the latest-edge version of Nextflow.</li>
<li><strong>Install nf-test</strong>: Downloads and installs nf-test.</li>
<li><strong>Run Tests</strong>: Runs nf-test without sharding.</li>
<li><strong>Run Tests</strong>: Runs nf-test with the <code>--ci</code> flag. This activates the CI mode. Instead of automatically storing a new snapshot as per usual, it will now fail the test if no reference snapshot is available. This enables tests to fail when a snapshot file was forgotten to be committed.</li>
</ol>
<h2 id="step-2-extending-to-use-sharding">Step 2: Extending to Use Sharding</h2>
<p>To distribute the tests across multiple jobs, you can set up sharding. Update your workflow file as follows:</p>
Expand Down Expand Up @@ -1273,7 +1273,7 @@ <h2 id="step-2-extending-to-use-sharding">Step 2: Extending to Use Sharding</h2>
<span class="w"> </span><span class="no">sudo mv nf-test /usr/local/bin/</span>

<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test --shard ${{ matrix.shard }}/${{ strategy.job-total }}</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }}</span>
</code></pre></div>
<h3 id="explanation-of-sharding">Explanation of Sharding:</h3>
<ol>
Expand Down Expand Up @@ -1315,7 +1315,7 @@ <h2 id="step-3-running-only-tests-affected-by-changed-files">Step 3: Running Onl
<span class="w"> </span><span class="no">sudo mv nf-test /usr/local/bin/</span>

<span class="w"> </span><span class="p p-Indicator">-</span><span class="w"> </span><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">Run Tests (Shard ${{ matrix.shard }}/${{ strategy.job-total }})</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test --shard ${{ matrix.shard }}/${{ strategy.job-total }} --changed-since HEAD^</span>
<span class="w"> </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">nf-test test --ci --shard ${{ matrix.shard }}/${{ strategy.job-total }} --changed-since HEAD^</span>
</code></pre></div>
<h3 id="explanation-of-changes">Explanation of Changes:</h3>
<ol>
Expand All @@ -1337,6 +1337,11 @@ <h2 id="step-4-adapting-nf-testconfig-to-trigger-full-test-runs">Step 4: Adaptin
- `'test-data/**/*'`: Changes to any files within the `test-data` directory will trigger a full test run.
</code></pre>
<p>This configuration ensures that critical changes always result in a comprehensive validation of the pipeline, providing additional confidence in your CI process.</p>
<h2 id="step-5-additional-useful-options">Step 5: Additional useful Options</h2>
<p>The <code>--filter</code> flag allows you to selectively run test cases based on their specified types. For example, you can filter tests by module, pipeline, workflow, or function. This is particularly useful when you have a large suite of tests and need to focus on specific areas of functionality. By separating multiple types with commas, you can run a customized subset of tests that match the exact criteria you're interested in, thereby saving time and resources.</p>
<p>The <code>--related-tests</code> flag enables you to identify and execute all tests related to the provided <code>.nf</code> or <code>nf.test</code> files. This is ideal for scenarios where you have made changes to specific files and want to ensure that only the relevant tests are run. You can provide multiple files by separating them with spaces, which makes it easy to manage and test multiple changes at once, ensuring thorough validation of your updates.</p>
<p>When the <code>--follow-dependencies</code> flag is set, the nf-test tool will automatically traverse and execute all tests for dependencies related to the files specified with the <code>--related-tests</code> flag. This ensures that any interdependent components are also tested, providing comprehensive coverage. This option is particularly useful for complex projects with multiple dependencies, as it bypasses the firewall calculation process and guarantees that all necessary tests are executed.</p>
<p>The <code>--changed-until</code> flag allows you to run tests based on changes made up until a specified commit hash or branch name. By default, this parameter uses <code>HEAD</code>, but you can specify any commit or branch to target the changes made up to that point. This is particularly useful for validating changes over a specific range of commits, ensuring that all modifications within that period are tested comprehensively.</p>
<h2 id="summary">Summary</h2>
<ol>
<li><strong>Without Sharding</strong>: A straightforward setup where all tests run in a single job.</li>
Expand Down

0 comments on commit 8200037

Please sign in to comment.