See an example at the end of this email how e.g. removing the chromium recipe from build repo would affect recipe code coverage there. Note that most builders are now using the recipe in build - although it only invokes one method in chromium_tests to avoid duplicating the code.
I'm wondering how can we solve the coverage issue to allow the recipes to move (which means deleting them from build). I can produce a doc if discussion gets more complicated.
1) Add "pragma: no cover". This is "obvious" and mechanical (easy to apply). However, I'm seriously concerned this would make ineffective any benefits we get from enforcing code coverage in recipes. I listed this for completeness.
2) Keep the chromium recipe in build repo until we can move more code to chromium/src. This also seems easy, but we'd hit similar issues trying to remove e.g. findit or bisection recipes. I don't think this solution would be generally applicable.
3) Add a way to specify downstream repos in recipes.cfg. Their tests would be executed and count towards code coverage. This may be a non-trivial change to the recipe engine. With support for fetching from gitiles, this is realistic even for otherwise huge repos like chromium/src. Now there's a downside: changes in this downstream repo can now result in coverage problems upstream.
4) Add more code to example recipes for corresponding modules. A possible downside is that some code may end up only being executed by the examples. If downstream expectations change, that also gives us real coverage in a way.
We'll need to solve this somehow to proceed with recipes-in-repos. If you see more options, please share.
Options 1 and 2 are here for completeness. I don't think they'd be applicable here, even short term. I'm considering options 3 and 4, leaning towards the last one (just adding more example code).
To give you a specific example, this is the result of removing chromium recipe from build repo and running recipe simulation tests. I was planning to move chromium_tests to chromium repo, but not the other modules yet.
Coverage Report Stmts Miss Cover Missing
---------------------------------------------------------------------------------------------------
scripts/slave/recipe_modules/archive/api 147 22 85% 120, 122, 126, 128-150, 270-272
scripts/slave/recipe_modules/chromium/api 369 21 94% 76, 197, 213, 215, 217, 219, 434-435, 733-758, 770
scripts/slave/recipe_modules/chromium/config 343 36 90% 251-252, 256, 264-265, 352-353, 420, 523-524, 529, 542, 550, 554, 558, 562, 566, 570, 580, 584, 589, 594, 598, 605, 610, 616, 628, 690-691, 700, 771, 784-787, 791
scripts/slave/recipe_modules/chromium_android/api 581 10 98% 588, 696, 1127-1135
scripts/slave/recipe_modules/chromium_android/chromium_config 73 1 99% 198
scripts/slave/recipe_modules/chromium_android/config 68 2 97% 214, 222
scripts/slave/recipe_modules/chromium_tests/api 400 64 84% 165, 300-301, 305-335, 437-499, 534, 555-556, 566, 585, 740, 757-766, 825-853
scripts/slave/recipe_modules/chromium_tests/bot_config_and_test_db 93 3 97% 67, 73, 187
scripts/slave/recipe_modules/chromium_tests/chromium_perf_fyi 34 2 94% 21, 26
scripts/slave/recipe_modules/chromium_tests/steps 738 142 81% 23, 81, 91, 99, 192, 354, 406, 435, 455, 466-471, 502-517, 528, 570, 574, 577-582, 585-601, 604, 613-635, 639, 669-688, 693, 857, 862, 870, 872, 960-965, 969, 973, 976, 980, 983-985, 992-1023, 1026-1030, 1035, 1056, 1083-1088, 1130-1135, 1149, 1262-1274, 1285, 1391, 1396, 1400, 1574, 1607, 1669, 1673, 1677, 1680-1682, 1725, 1728-1746
scripts/slave/recipe_modules/goma/api 98 3 97% 90, 110-112
scripts/slave/recipe_modules/isolate/api 73 6 92% 192, 196-204
scripts/slave/recipe_modules/swarming/api 351 7 98% 739, 743-744, 788, 803-805
scripts/slave/recipe_modules/test_utils/test_api 80 9 89% 47, 56-59, 134-135, 153, 158
---------------------------------------------------------------------------------------------------
TOTAL 16494 328 98%