Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed)

Created:
7 years, 3 months ago by iannucci
Modified:
7 years, 3 months ago
Reviewers:
agable
CC:
chromium-reviews, cmp-cc_chromium.org, ilevy-cc_chromium.org, xusydoc+watch_chromium.org, kjellander+cc_chromium.org
Visibility:
Public.

Description

Refactor the way that TestApi works so that it is actually useful. I think this is a reasonable compromise beteween a couple of the options we discussed. It basically boils down to two things: * Modules now have a test_api. * This is injected into the api's "test_api" member. * This is also provided in a module tree to the GenTests api parameter exactly the way that the normal module tree is provided. The recipe's DEPS variable determines which test api's will be available to the recipe. If the module depends on others, the other modules' test_api's will be injected into the test_api's "m" member. * Test data is now represented by a bunch of add-able TestData objects * Better auto-routing of test information from the test_api's to the actual objects which consume it. * Steps can now have default_step_data, which should be an instance of StepTestData. This allows modules to provide mock data for themselves. * I broke up recipe_api into a bunch of (hopefully) more-logical pieces * Expanded coverage to include module examples and test_api's * Standardized module/recipe loading (and the path which they use for lookups). R=agable@chromium.org BUG=292270, 292298 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=225021

Patch Set 1 #

Patch Set 2 : Make mock_fn provide module-level defaults by using it as the basis for the test_data_item #

Patch Set 3 : Move gclient test_api to got_revisions cl #

Total comments: 6

Patch Set 4 : Yeaaaahhh #

Patch Set 5 : Yeeeeaaaahhhhhh! #

Total comments: 1

Patch Set 6 : rebase #

Total comments: 19

Patch Set 7 : Address comments #

Patch Set 8 : try again #

Patch Set 9 : once more... #

Total comments: 5

Patch Set 10 : more docs #

Patch Set 11 : Rebase #

Patch Set 12 : License headers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1444 lines, -1645 lines) Patch
M scripts/slave/annotated_run.py View 1 2 3 4 5 6 7 8 9 5 chunks +61 lines, -87 lines 0 comments Download
M scripts/slave/recipe_api.py View 1 2 3 4 5 6 7 8 9 3 chunks +74 lines, -219 lines 0 comments Download
A + scripts/slave/recipe_config.py View 1 2 3 0 chunks +-1 lines, --1 lines 0 comments Download
D scripts/slave/recipe_configs_util.py View 1 2 3 4 5 1 chunk +0 lines, -762 lines 0 comments Download
A scripts/slave/recipe_loader.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +255 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/android/api.py View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -6 lines 0 comments Download
M scripts/slave/recipe_modules/android/config.py View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
A scripts/slave/recipe_modules/android/test_api.py View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/chromite/example.py View 1 2 3 4 5 6 1 chunk +2 lines, -4 lines 0 comments Download
M scripts/slave/recipe_modules/chromium/config.py View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M scripts/slave/recipe_modules/chromium_android/api.py View 1 2 3 4 5 6 7 8 9 4 chunks +3 lines, -4 lines 0 comments Download
M scripts/slave/recipe_modules/chromium_android/config.py View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M scripts/slave/recipe_modules/gclient/api.py View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M scripts/slave/recipe_modules/gclient/config.py View 1 2 3 4 5 1 chunk +2 lines, -3 lines 0 comments Download
M scripts/slave/recipe_modules/gclient/example.py View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M scripts/slave/recipe_modules/generator_script/api.py View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -2 lines 0 comments Download
M scripts/slave/recipe_modules/generator_script/example.py View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -17 lines 0 comments Download
A scripts/slave/recipe_modules/generator_script/test_api.py View 1 2 3 4 5 6 1 chunk +9 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/git/example.py View 1 2 3 4 5 6 2 chunks +4 lines, -9 lines 0 comments Download
M scripts/slave/recipe_modules/json/__init__.py View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M scripts/slave/recipe_modules/json/api.py View 1 2 3 4 5 6 7 8 9 5 chunks +30 lines, -98 lines 0 comments Download
A scripts/slave/recipe_modules/json/test_api.py View 1 2 3 4 5 6 7 8 9 1 chunk +32 lines, -0 lines 0 comments Download
A scripts/slave/recipe_modules/json/util.py View 1 chunk +71 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/path/api.py View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
A scripts/slave/recipe_modules/path/test_api.py View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/platform/api.py View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
A scripts/slave/recipe_modules/platform/test_api.py View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
A scripts/slave/recipe_modules/properties/test_api.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +56 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/python/__init__.py View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M scripts/slave/recipe_modules/python/api.py View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
A scripts/slave/recipe_modules/raw_io/__init__.py View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A scripts/slave/recipe_modules/raw_io/api.py View 1 2 3 4 5 6 7 8 9 1 chunk +66 lines, -0 lines 0 comments Download
M scripts/slave/recipe_modules/step/api.py View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M scripts/slave/recipe_modules/step/example.py View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
A scripts/slave/recipe_test_api.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +338 lines, -0 lines 0 comments Download
A scripts/slave/recipe_util.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +115 lines, -0 lines 0 comments Download
M scripts/slave/recipes/android/android_builder.py View 1 2 3 4 5 6 2 chunks +32 lines, -35 lines 0 comments Download
M scripts/slave/recipes/android_webview_aosp.py View 1 2 3 4 5 6 2 chunks +35 lines, -77 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.py View 1 2 3 4 5 6 7 8 9 3 chunks +24 lines, -82 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/linux_fail_debug.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/linux_fail_debug_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/linux_fail_release.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/linux_fail_release_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/mac_fail_debug.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/mac_fail_debug_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/mac_fail_release.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/mac_fail_release_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/warn_on_flakey.json View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/win_fail_debug.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/win_fail_debug_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/win_fail_release.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/blink_trybot.expected/win_fail_release_git.json View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M scripts/slave/recipes/chromium.py View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -11 lines 0 comments Download
M scripts/slave/recipes/chromium.expected/fail.json View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M scripts/slave/recipes/gatekeeper.py View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M scripts/slave/recipes/gpu.py View 1 2 3 4 5 6 7 8 9 2 chunks +11 lines, -18 lines 0 comments Download
M scripts/slave/recipes/polymer.py View 1 2 3 4 5 6 1 chunk +17 lines, -16 lines 0 comments Download
M scripts/slave/recipes/run_presubmit.py View 1 2 3 4 5 6 1 chunk +7 lines, -10 lines 0 comments Download
M scripts/slave/recipes/v8.py View 1 2 3 4 5 6 2 chunks +19 lines, -28 lines 0 comments Download
A + scripts/slave/recipes/v8.expected/mips_target.json View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M scripts/slave/unittests/recipe_configs_test.py View 1 2 3 4 5 chunks +8 lines, -8 lines 0 comments Download
M scripts/slave/unittests/recipes_test.py View 1 2 3 4 5 6 7 8 9 10 9 chunks +39 lines, -122 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
iannucci
7 years, 3 months ago (2013-09-14 11:48:51 UTC) #1
agable
https://codereview.chromium.org/23889036/diff/6001/scripts/slave/recipe_api.py File scripts/slave/recipe_api.py (right): https://codereview.chromium.org/23889036/diff/6001/scripts/slave/recipe_api.py#newcode146 scripts/slave/recipe_api.py:146: for v in submod.api.__dict__.itervalues(): Since the API is the ...
7 years, 3 months ago (2013-09-16 20:29:24 UTC) #2
agable
So, to follow up with what we discussed: Rather than having a 'mock_fn' attribute on ...
7 years, 3 months ago (2013-09-16 21:45:29 UTC) #3
iannucci
On 2013/09/16 21:45:29, Aaron Gable wrote: > So, to follow up with what we discussed: ...
7 years, 3 months ago (2013-09-19 09:16:05 UTC) #4
iannucci
On 2013/09/19 09:16:05, iannucci wrote: > On 2013/09/16 21:45:29, Aaron Gable wrote: > > So, ...
7 years, 3 months ago (2013-09-19 09:45:00 UTC) #5
iannucci
https://codereview.chromium.org/23889036/diff/15001/scripts/slave/recipe_modules/chromium_android/api.py File scripts/slave/recipe_modules/chromium_android/api.py (left): https://codereview.chromium.org/23889036/diff/15001/scripts/slave/recipe_modules/chromium_android/api.py#oldcode36 scripts/slave/recipe_modules/chromium_android/api.py:36: s.custom_vars = self.c.custom_vars I took this out because it ...
7 years, 3 months ago (2013-09-19 21:28:19 UTC) #6
agable
Buncha random comments that so far add up to "not quite lg2me yet". https://codereview.chromium.org/23889036/diff/21001/scripts/slave/annotated_run.py File ...
7 years, 3 months ago (2013-09-21 02:05:31 UTC) #7
iannucci
https://chromiumcodereview.appspot.com/23889036/diff/21001/scripts/slave/annotated_run.py File scripts/slave/annotated_run.py (right): https://chromiumcodereview.appspot.com/23889036/diff/21001/scripts/slave/annotated_run.py#newcode264 scripts/slave/annotated_run.py:264: setattr(o, placeholder_name, lst[0]) On 2013/09/21 02:05:31, Aaron Gable wrote: ...
7 years, 3 months ago (2013-09-21 03:12:33 UTC) #8
agable
This now looks good modulo a couple small comments and one big one (re: addition ...
7 years, 3 months ago (2013-09-23 22:57:57 UTC) #9
iannucci
ptal https://codereview.chromium.org/23889036/diff/34001/scripts/slave/recipe_modules/raw_io/api.py File scripts/slave/recipe_modules/raw_io/api.py (right): https://codereview.chromium.org/23889036/diff/34001/scripts/slave/recipe_modules/raw_io/api.py#newcode31 scripts/slave/recipe_modules/raw_io/api.py:31: class RawApi(recipe_api.RecipeApi): On 2013/09/23 22:57:58, Aaron Gable wrote: ...
7 years, 3 months ago (2013-09-24 02:18:50 UTC) #10
agable
lgtm
7 years, 3 months ago (2013-09-24 16:38:32 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/23889036/114001
7 years, 3 months ago (2013-09-24 17:26:06 UTC) #12
commit-bot: I haz the power
Presubmit check for 23889036-114001 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 3 months ago (2013-09-24 17:27:26 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/iannucci@chromium.org/23889036/117001
7 years, 3 months ago (2013-09-24 17:30:06 UTC) #14
commit-bot: I haz the power
7 years, 3 months ago (2013-09-24 17:32:50 UTC) #15
Message was sent while issue was closed.
Change committed as 225021

Powered by Google App Engine
This is Rietveld 408576698