@@ -9,20 +9,25 @@ The Job Tester (``jote``) is used to run unit tests located in
99Data Manager Job implementation repositories against the Job's
1010container image.
1111
12- Job implementations are required to provide a Manifest file (``manifest.yaml ``)
13- that lists Job Definition files (in the Job repository's ``data-manager ``
14- directory). The Manifest names at least ine file and the Job Definition
15- should define at least one test for every Job. ``jote `` runs the tests
16- but also ensures the repository structure meets the Data Manager requirements.
12+ Job implementations are required to provide at least one manifest file
13+ that lists Job Definition files (these reside in the ``data-manager ``
14+ of the repository being tested). The default manifest file is
15+ ``manifest.yaml `` but you can name your own and have more than one.
1716
18- Tests are defined in the Job definition file. Here's a snippet illustrating a
17+ Each Manifest must name at least one file and the corresponding
18+ Job Definition file should define at least one test for every Job.
19+ ``jote `` runs the tests but also ensures the repository structure is as
20+ expected and applies strict formatting of the YAML files.
21+
22+ Here's a snippet from a Job definition file illustrating a
1923Job (``max-min-picker ``) with a test called ``simple-execution ``.
2024
2125The test defines an input option (a file) and some other command options.
22- The ``checks `` section defines the exit criteria of a successful test.
26+ The ``checks `` section is used to define the exit criteria of the test.
2327In this case the container must exit with code ``0 `` and the file
2428``diverse.smi `` must be found (in the mounted project directory), i.e
25- it must *exist * and contain ``100 `` lines::
29+ it must *exist * and contain ``100 `` lines. ``jote `` will ensure that these
30+ expectations are satisfied::
2631
2732 jobs:
2833 [...]
@@ -43,6 +48,21 @@ it must *exist* and contain ``100`` lines::
4348 - exists: true
4449 - lineCount: 100
4550
51+ Running tests
52+ -------------
53+
54+ Run ``jote `` from the root of a clone of the Data Manager Job implementation
55+ repository that you want to test::
56+
57+ jote
58+
59+ You can display the utility's help with::
60+
61+ jote --help
62+
63+ Ignoring tests
64+ --------------
65+
4666Individual tests can be prevented from being executed by adding an `ignore `
4767declaration::
4868
@@ -55,6 +75,8 @@ declaration::
5575 ignore:
5676 [...]
5777
78+ Test run levels
79+ ---------------
5880Tests can be assigned a ``run-level ``. Run-levels are numerical value (1..100)
5981that can be used to classify your tests, often using it to represent
6082execution time. By default all tests that have no run-level and those with
@@ -73,10 +95,57 @@ You define the run-level in the root block of the job specification::
7395 run-level: 5
7496 [...]
7597
98+ Test timeouts
99+ -------------
100+
101+ ``jote `` lets each test run for 10 minutes before cancelling (and failing) them.
102+ If you expect your test to run for more than 10 minutes you can use the
103+ ``timeout-minutes `` property to define your own test-specific value::
104+
105+ jobs:
106+ [...]
107+ max-min-picker:
108+ [...]
109+ tests:
110+ simple-execution:
111+ timeout-minutes: 120
112+ [...]
113+
114+ Remember that job tests are *unit tests *, so long-running tests should be
115+ discouraged.
116+
117+ Nextflow execution
118+ ------------------
119+ Job image type can be ``simple `` or ``nextflow ``. Simple jobs are executed in
120+ the container image you've built and should behave much the same as they do
121+ when run within the Data Manager. Nextflow jobs on the other hand are executed
122+ using the shell, relying on Docker as the execution run-time for the processes
123+ in your workflow.
124+
125+ be aware that nextflow tests run by ``jote `` run under different conditions
126+ compared to those running under the Data Manager's control, where nextflow
127+ will be executed within a Kubernetes environment rather than docker. This
128+ introduces variability. Tests that run under ``jote `` *are not * running in the
129+ same environment or under the same memory or CPU constraints. Remember this
130+ when testing - i.e. a successful nextflow test under ``jote `` does not
131+ necessarily mean that it will execute successfully within the Data Manager.
132+ Successful nextflow tests run with ``jote `` are just and indication that
133+ the same execution might work in the Data Manager.
134+
135+ It's your responsibility to provide a suitable nextflow for shell execution,
136+ which ``jote `` simply uses when executing the test's ``command `` that's
137+ defined in your Job definition.
138+
139+ When running nextflow jobs ``jote `` writes a ``nextflow.config `` to the
140+ test's simulated project directory prior to executing the command.
141+ ``jote `` *will not * let you have a nextflow config in your home directory
142+ as any settings found there would be merged with the file ``jote `` writes,
143+ potentially disturbing the execution behanviour.
144+
76145Installation
77- ------------
146+ ============
78147
79- Pyconf is published on `PyPI `_ and can be installed from
148+ `` jote`` `` is published on `PyPI `_ and can be installed from
80149there::
81150
82151 pip install im-jote
@@ -89,18 +158,6 @@ To use the utility you will need to have installed `Docker`_.
89158.. _PyPI : https://pypi.org/project/im-jote/
90159.. _Docker : https://docs.docker.com/get-docker/
91160
92- Running tests
93- -------------
94-
95- Run ``jote `` from the root of a clone of the Data Manager Job implementation
96- repository that you want to test::
97-
98- jote
99-
100- You can display the utility's help with::
101-
102- jote --help
103-
104161Get in touch
105162------------
106163
0 commit comments