OLD | NEW |
1 Recipes | 1 Recipes |
2 ======= | 2 ======= |
3 Recipes are a flexible way to specify How to Do Things, without knowing too much | 3 Recipes are a flexible way to specify How to Do Things, without knowing too much |
4 about those Things. | 4 about those Things. |
5 | 5 |
6 | 6 |
7 Anecdote | 7 Anecdote |
8 -------- | 8 -------- |
9 In the before-times, circa 2003, there was a quaint build system called BuildBot
. | 9 In the before-times, circa 2003, there was a quaint build system called BuildBot
. |
10 BuildBot had many, many features, and was written to encapsulate every aspect of | 10 BuildBot had many, many features, and was written to encapsulate every aspect of |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 data>}`. See module docstrings to see what they accept for mocks. | 335 data>}`. See module docstrings to see what they accept for mocks. |
336 * *step_mocks*: This is a dictionary which defines the mock data for | 336 * *step_mocks*: This is a dictionary which defines the mock data for |
337 various `recipe_api.Placeholder` objects. These are explained more in | 337 various `recipe_api.Placeholder` objects. These are explained more in |
338 a later section. This dictionary is in the form of `{<step name>: {<mod | 338 a later section. This dictionary is in the form of `{<step name>: {<mod |
339 name>: <mod data>}}` | 339 name>: <mod data>}}` |
340 * There is one 'special' mod name, which is '$R'. This module refers to the | 340 * There is one 'special' mod name, which is '$R'. This module refers to the |
341 return code of the step, and takes an integer. If it is missing, it is | 341 return code of the step, and takes an integer. If it is missing, it is |
342 assumed that the step succeeded with a retcode of 0. | 342 assumed that the step succeeded with a retcode of 0. |
343 | 343 |
344 The `api` passed to GenTests is confusingly **NOT** the same as the recipe api. | 344 The `api` passed to GenTests is confusingly **NOT** the same as the recipe api. |
345 It's actually an instance of `unittests/recipes_test.py:TestApi()`. This is | 345 It's actually an instance of `recipe_test_api.py:RecipeTestApi()`. This is |
346 adimittedly pretty weak, and it would be great to have the test api | 346 adimittedly pretty weak, and it would be great to have the test api |
347 automatically created via modules. On the flip side, the test api is much less | 347 automatically created via modules. On the flip side, the test api is much less |
348 necessary than the recipe api, so this transformation has not been designed yet. | 348 necessary than the recipe api, so this transformation has not been designed yet. |
349 | 349 |
350 | 350 |
351 What is that config business? | 351 What is that config business? |
352 ----------------------------- | 352 ----------------------------- |
353 **Configs are a way for a module to expose it's "global" state in a reusable | 353 **Configs are a way for a module to expose it's "global" state in a reusable |
354 way.** | 354 way.** |
355 | 355 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 of the json module to see how this is implemented. | 605 of the json module to see how this is implemented. |
606 | 606 |
607 | 607 |
608 How do I know what modules to use? | 608 How do I know what modules to use? |
609 ---------------------------------- | 609 ---------------------------------- |
610 Use `tools/show_me_the_modules.py`. It's super effective! | 610 Use `tools/show_me_the_modules.py`. It's super effective! |
611 | 611 |
612 | 612 |
613 How do I run those tests you were talking about? | 613 How do I run those tests you were talking about? |
614 ------------------------------------------------ | 614 ------------------------------------------------ |
615 To test all the recipes/apis, use `slave/unittests/recipes_test.py`. To set new | 615 To test all the recipes/apis, use `slave/unittests/recipe_simulation_test.py`. |
616 expectations `slave/unittests/recipes_test.py --train`. | 616 To set new expectations `slave/unittests/recipe_simulation_test.py train`. |
617 | 617 |
618 To test all the configs, use `slave/unittests/recipe_configs_test.py`. To set | |
619 new expectations `slave/unittests/recipe_configs_test.py --train`. | |
620 | 618 |
621 | 619 |
622 Where's the docs on `*.py`? | 620 Where's the docs on `*.py`? |
623 -------------------------------------------- | 621 -------------------------------------------- |
624 Check the docstrings in `*.py`. `<trollface text="Problem?"/>` | 622 Check the docstrings in `*.py`. `<trollface text="Problem?"/>` |
625 | 623 |
626 In addition, most recipe modules have an `example.py` file which exercises most | 624 In addition, most recipe modules have an `example.py` file which exercises most |
627 of the code in the module for both test coverage and example purposes. | 625 of the code in the module for both test coverage and example purposes. |
628 | 626 |
629 If you want to know what keys a step dictionary can take, take a look at | 627 If you want to know what keys a step dictionary can take, take a look at |
630 `common/annotator.py`. | 628 `common/annotator.py`. |
631 | 629 |
OLD | NEW |