You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/snakefiles/reporting.rst
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -329,3 +329,26 @@ For example, this allows you to set a logo at the top (by using CSS to inject a
329
329
For an example with a custom stylesheet defining a logo, see :download:`the report here <../../tests/test_report/expected-results/report.html>` (with a custom branding for the University of Duisburg-Essen).
330
330
For the complete mechanics, you can also have a look at the `full example source code <https://github.com/snakemake/snakemake/tree/main/tests/test_report/>`__ and :download:`the custom stylesheet with the logo definition <../../tests/test_report/custom-stylesheet.css>`.
331
331
332
+
Custom report metadata
333
+
^^^^^^^^^^^^^^^^^^^^^^
334
+
335
+
You can define custom metadata that is displayed on the landing page of the report.
336
+
The metadata is provided as a `YTE <https://yte-template-engine.github.io>`_ yaml template.
Copy file name to clipboardExpand all lines: docs/snakefiles/testing.rst
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,26 @@ By running
13
13
14
14
Snakemake is instructed to take one representative job for each rule and copy its input files to a hidden folder ``.tests/unit``,
15
15
along with generating test cases for Pytest_.
16
+
Pytest_ tests can be run as:
16
17
17
-
Importantly, note that such unit tests shall not be generated from big data, as they should usually be finished in a few seconds.
18
-
Further, it makes sense to store the generated unit tests in version control (e.g. git), such that huge files are not recommended.
19
-
Instead, we suggest to first execute the workflow that shall be tested with some kind of small dummy datasets, and then use the results thereof to generate the unit tests.
20
-
The small dummy datasets can in addition be used to generate an integration test, that could e.g. be stored under ``.tests/integration``, next to the unit tests.
18
+
.. code-block:: bash
19
+
20
+
pytest .tests/unit/
21
+
22
+
or, optionally, if you want to use a local conda cache and disable pytest caching:
Each auto-generated unit test is stored in a file ``.tests/unit/test_<rulename>.py``, and executes just the one representative job of the respective rule.
23
29
After successful execution of the job, it will compare the obtained results with those that have been present when running ``snakemake --generate-unit-tests``.
24
-
By default, the comparison happens byte by byte (using ``cmp``). This behavior can be overwritten by modifying the test file.
30
+
By default, the comparison happens byte by byte (using ``cmp/zcmp/bzcmp/xzcmp``). This behavior can be overwritten by modifying the test file.
31
+
32
+
NOTE: Importantly, such unit tests shall not be generated from big data, as they should usually be finished in a few seconds.
33
+
Furthermore, it makes sense to store the generated unit tests in version control (e.g. git), such that huge files are also not recommended.
34
+
Instead, we suggest to first execute the workflow that shall be tested with some kind of small dummy datasets while keeping all temp files (``--notemp``),
35
+
and then use the results thereof to generate the unit tests.
36
+
The small dummy datasets can in addition be used to generate an integration test, that could e.g. be stored under ``.tests/integration``, next to the unit tests.
0 commit comments