Simple fix.
Details
Details
Unittests pass. Otherwise it's just docs.
Diff Detail
Diff Detail
- Repository
- rLTRN libtaskotron
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Simple fix.
Unittests pass. Otherwise it's just docs.
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| Path | Packages | |||
|---|---|---|---|---|
| M | docs/source/quickstart.rst (4 lines) | |||
| M | docs/source/resultyaml.rst (2 lines) | |||
| M | libtaskotron/directives/__init__.py (2 lines) | |||
| M | testing/functest_runner.py (4 lines) |
| Commit | Tree | Parents | Author | Summary | Date |
|---|---|---|---|---|---|
| 2f380ff2aded | 7e09250c0bfb | 37cc9d63fd00 | Martin Krizek | Fix references to 'recipe', it is 'formula' now (Show More…) | Oct 1 2015, 2:09 PM |
| Show All 21 Lines | |||||
| 22 | `Detailed install instructions <index.html#install-libtaskotron>`_ | 22 | `Detailed install instructions <index.html#install-libtaskotron>`_ | ||
| 23 | 23 | | |||
| 24 | 24 | | |||
| 25 | Run | 25 | Run | ||
| 26 | === | 26 | === | ||
| 27 | 27 | | |||
| 28 | :: | 28 | :: | ||
| 29 | 29 | | |||
| 30 | runtask -i <item> -t <type> -a <arch> <yaml recipe> | 30 | runtask -i <item> -t <type> -a <arch> <yaml formula> | ||
| 31 | 31 | | |||
| 32 | `More details on running tasks <index.html#running-tasks>`_ | 32 | `More details on running tasks <index.html#running-tasks>`_ | ||
| 33 | 33 | | |||
| 34 | 34 | | |||
| 35 | Formulae: General Syntax | 35 | Formulae: General Syntax | ||
| 36 | ======================== | 36 | ======================== | ||
| 37 | 37 | | |||
| 38 | .. code-block:: yaml | 38 | .. code-block:: yaml | ||
| Show All 21 Lines | 54 | actions: | |||
| 60 | 60 | | |||
| 61 | - name: next step of formula | 61 | - name: next step of formula | ||
| 62 | nextdirectivename: | 62 | nextdirectivename: | ||
| 63 | arg1: ${firststep_output} | 63 | arg1: ${firststep_output} | ||
| 64 | 64 | | |||
| 65 | `Detailed instructions on writing tasks <writingtasks.html#creating-a-new-task>`_ | 65 | `Detailed instructions on writing tasks <writingtasks.html#creating-a-new-task>`_ | ||
| 66 | 66 | | |||
| 67 | 67 | | |||
| 68 | Recipes: Examples From Our Git | 68 | Formulae: Examples From Our Git | ||
| 69 | ============================== | 69 | ============================== | ||
| 70 | 70 | | |||
| 71 | Running Rpmlint | 71 | Running Rpmlint | ||
| 72 | --------------- | 72 | --------------- | ||
| 73 | 73 | | |||
| 74 | `Rpmlint <https://bitbucket.org/fedoraqa/task-rpmlint>`_ | 74 | `Rpmlint <https://bitbucket.org/fedoraqa/task-rpmlint>`_ | ||
| 75 | 75 | | |||
| 76 | :: | 76 | :: | ||
| Show All 19 Lines | |||||
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 87 | - item: tzdata-2014f-1.fc20 | |||
|---|---|---|---|---|---|
| 93 | arch: x86_64 | 93 | arch: x86_64 | ||
| 94 | 94 | | |||
| 95 | Going top-down, the new fields are ``artifact``, ``checkname``, ``note``, ``arch`` and ``package``. | 95 | Going top-down, the new fields are ``artifact``, ``checkname``, ``note``, ``arch`` and ``package``. | ||
| 96 | 96 | | |||
| 97 | ``artifact`` contains the name of a file in the ``$artifactsdir``, that contains detailed | 97 | ``artifact`` contains the name of a file in the ``$artifactsdir``, that contains detailed | ||
| 98 | information about the check run. In this example the upgradepath check produced an user-friendly | 98 | information about the check run. In this example the upgradepath check produced an user-friendly | ||
| 99 | report in HTML format, and the author decided to link it as an artifact. | 99 | report in HTML format, and the author decided to link it as an artifact. | ||
| 100 | 100 | | |||
| 101 | ``checkname`` allows overriding the value devised from the Taskotron recipe. It is useful | 101 | ``checkname`` allows overriding the value devised from the Taskotron formula. It is useful | ||
| 102 | when your task implements multiple checks, and you want to report the per-check results | 102 | when your task implements multiple checks, and you want to report the per-check results | ||
| 103 | separately (e.g. ``repo-sanity`` could output ``depcheck``, ``upgradepath`` and ``repoclosure`` | 103 | separately (e.g. ``repo-sanity`` could output ``depcheck``, ``upgradepath`` and ``repoclosure`` | ||
| 104 | results in one run). | 104 | results in one run). | ||
| 105 | 105 | | |||
| 106 | ``note`` adds a short valuable information that should be easily visible in the result overview. | 106 | ``note`` adds a short valuable information that should be easily visible in the result overview. | ||
| 107 | 107 | | |||
| 108 | ``arch`` and ``package`` are custom fields that do not have any special meaning for the Taskotron | 108 | ``arch`` and ``package`` are custom fields that do not have any special meaning for the Taskotron | ||
| 109 | tooling, but provide additional information about the check results as such. | 109 | tooling, but provide additional information about the check results as such. | ||
| Show All 11 Lines | |||||
| 1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- | ||
|---|---|---|---|---|---|
| 2 | # Copyright 2009-2014, Red Hat, Inc. | 2 | # Copyright 2009-2014, Red Hat, Inc. | ||
| 3 | # License: GPL-2.0+ <http://spdx.org/licenses/GPL-2.0+> | 3 | # License: GPL-2.0+ <http://spdx.org/licenses/GPL-2.0+> | ||
| 4 | # See the LICENSE file for more details on Licensing | 4 | # See the LICENSE file for more details on Licensing | ||
| 5 | from __future__ import absolute_import | 5 | from __future__ import absolute_import | ||
| 6 | 6 | | |||
| 7 | '''Directives are standalone code snippets which act as helper functions when | 7 | '''Directives are standalone code snippets which act as helper functions when | ||
| 8 | the task needs to achieve something inside the task recipe file. They allow | 8 | the task needs to achieve something inside the task formula file. They allow | ||
| 9 | to prepare the environment for running the task, or to do something with the | 9 | to prepare the environment for running the task, or to do something with the | ||
| 10 | task output. The benefit of directives is that they share useful code between | 10 | task output. The benefit of directives is that they share useful code between | ||
| 11 | tasks, so that the tasks don't have to include a lot of commonly needed | 11 | tasks, so that the tasks don't have to include a lot of commonly needed | ||
| 12 | functionality and can rely on directives to do that instead. | 12 | functionality and can rely on directives to do that instead. | ||
| 13 | 13 | | |||
| 14 | Examples include downloading RPMs from Koji, creating Yum repositories, | 14 | Examples include downloading RPMs from Koji, creating Yum repositories, | ||
| 15 | reporting results to ResultsDB, or running an arbitrary python script (which | 15 | reporting results to ResultsDB, or running an arbitrary python script (which | ||
| 16 | is also used for the main task script execution). | 16 | is also used for the main task script execution). | ||
| ▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines | |||||
| Show All 9 Lines | |||||
| 10 | from libtaskotron import runner | 10 | from libtaskotron import runner | ||
| 11 | from libtaskotron import logger | 11 | from libtaskotron import logger | ||
| 12 | 12 | | |||
| 13 | class TestRunnerMain(): | 13 | class TestRunnerMain(): | ||
| 14 | '''Test main()''' | 14 | '''Test main()''' | ||
| 15 | 15 | | |||
| 16 | def test_debug(self, tmpdir, monkeypatch, capfd): | 16 | def test_debug(self, tmpdir, monkeypatch, capfd): | ||
| 17 | '''Test whether --debug cmdline option works''' | 17 | '''Test whether --debug cmdline option works''' | ||
| 18 | fake_recipe_path = tmpdir.join('nonexistent.yml').strpath | 18 | fake_formula_path = tmpdir.join('nonexistent.yml').strpath | ||
| 19 | fake_cmdline = ['runner.py', '--debug', fake_recipe_path] | 19 | fake_cmdline = ['runner.py', '--debug', fake_formula_path] | ||
| 20 | monkeypatch.setattr(sys, 'argv', fake_cmdline) | 20 | monkeypatch.setattr(sys, 'argv', fake_cmdline) | ||
| 21 | 21 | | |||
| 22 | with pytest.raises(IOError): | 22 | with pytest.raises(IOError): | ||
| 23 | # an error should be raised, because the yaml file does not exist | 23 | # an error should be raised, because the yaml file does not exist | ||
| 24 | runner.main() | 24 | runner.main() | ||
| 25 | 25 | | |||
| 26 | # even though the error was raised, the debug level should already be set | 26 | # even though the error was raised, the debug level should already be set | ||
| 27 | assert logger.stream_handler.level == logging.DEBUG | 27 | assert logger.stream_handler.level == logging.DEBUG | ||
| 28 | 28 | | |||
| 29 | # and debug messages should be captured | 29 | # and debug messages should be captured | ||
| 30 | msg = "testing debug logging with --debug cmdline option" | 30 | msg = "testing debug logging with --debug cmdline option" | ||
| 31 | out, err = capfd.readouterr() | 31 | out, err = capfd.readouterr() | ||
| 32 | logger.log.debug(msg) | 32 | logger.log.debug(msg) | ||
| 33 | out, err = capfd.readouterr() | 33 | out, err = capfd.readouterr() | ||
| 34 | assert msg in err | 34 | assert msg in err | ||