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

Issue 2387763003: Add initial postprocess unit test thingy. (Closed)

Created:
4 years, 2 months ago by iannucci
Modified:
4 years, 2 months ago
CC:
chromium-reviews, infra-reviews+recipes-py_chromium.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add post_process hooks to recipe testing facilities. These post_process hooks allow the user to run arbitrary assertions on their expectation outputs, and also allows arbitrary filtering of the expectation data (removing steps/fields, items from lists, etc.), including reduction of the expectations all the way down to an empty dictionary (which will remove the expectation file from disk). This facility supersedes and replaces the recently-introduced whitelisting capabilities and will hopefully give recipe authors the testing flexibility they need to achieve confidence in the behavior of their recipes. R=dnj@chromium.org, dpranke@chromium.org, machenbach@chromium.org, martiniss@chromium.org BUG=459361 Committed: https://github.com/luci/recipes-py/commit/d97fe4474b8ebefb906e594aba840fff58720dae

Patch Set 1 #

Total comments: 101

Patch Set 2 : A bunch more smarts #

Patch Set 3 : Fix nits and improve stuff. Tests next #

Patch Set 4 : Move added line #

Patch Set 5 : fix nit, recipe test #

Patch Set 6 : more comments #

Total comments: 9

Patch Set 7 : Implement partial checker_test, rewrite VerifySubset #

Total comments: 16

Patch Set 8 : More tests #

Patch Set 9 : Fix recipe example #

Patch Set 10 : Add nested statement too #

Total comments: 22

Patch Set 11 : rewrite parser code #

Total comments: 14

Patch Set 12 : Fix bug and nits #

Patch Set 13 : Fix nits #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1304 lines, -102 lines) Patch
A recipe_engine/checker.py View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +423 lines, -0 lines 0 comments Download
M recipe_engine/env.py View 1 chunk +1 line, -0 lines 0 comments Download
A recipe_engine/post_process.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +194 lines, -0 lines 0 comments Download
M recipe_engine/recipe_test_api.py View 1 2 3 4 5 6 7 8 6 chunks +102 lines, -35 lines 0 comments Download
M recipe_engine/simulation_test.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 6 chunks +64 lines, -47 lines 0 comments Download
M recipe_engine/step_runner.py View 1 chunk +3 lines, -2 lines 0 comments Download
M recipe_engine/third_party/expect_tests/__init__.py View 1 1 chunk +1 line, -1 line 0 comments Download
M recipe_engine/third_party/expect_tests/handle_test.py View 1 2 3 4 5 3 chunks +16 lines, -1 line 0 comments Download
M recipe_engine/third_party/expect_tests/handle_train.py View 3 chunks +12 lines, -1 line 0 comments Download
M recipe_engine/third_party/expect_tests/type_definitions.py View 1 2 3 4 5 1 chunk +49 lines, -1 line 0 comments Download
A recipe_engine/unittests/checker_test.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +264 lines, -0 lines 0 comments Download
A recipe_engine/unittests/post_process_test.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +146 lines, -0 lines 0 comments Download
M recipes/engine_tests/whitelist_steps.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +22 lines, -10 lines 0 comments Download
M recipes/engine_tests/whitelist_steps.expected/all_steps.json View 1 chunk +7 lines, -0 lines 0 comments Download
M recipes/engine_tests/whitelist_steps.expected/selection.json View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 37 (7 generated)
iannucci
4 years, 2 months ago (2016-10-01 08:24:36 UTC) #1
iannucci
This is mostly groundwork/proof of concept (with some light tests for flavor). So what's here: ...
4 years, 2 months ago (2016-10-01 08:52:44 UTC) #2
martiniss
looking pretty good https://codereview.chromium.org/2387763003/diff/1/recipe_engine/post_process.py File recipe_engine/post_process.py (right): https://codereview.chromium.org/2387763003/diff/1/recipe_engine/post_process.py#newcode3 recipe_engine/post_process.py:3: # that can be found in ...
4 years, 2 months ago (2016-10-03 19:14:20 UTC) #3
Dirk Pranke
I may not get to this in a timely manner, so don't block on me ...
4 years, 2 months ago (2016-10-03 19:52:25 UTC) #4
dnj
https://codereview.chromium.org/2387763003/diff/1/recipe_engine/post_process.py File recipe_engine/post_process.py (right): https://codereview.chromium.org/2387763003/diff/1/recipe_engine/post_process.py#newcode24 recipe_engine/post_process.py:24: if not field_set: Can we have an error if ...
4 years, 2 months ago (2016-10-04 16:42:36 UTC) #5
iannucci
Although I appreciate the reminders to add docs, you may not have seen my initial ...
4 years, 2 months ago (2016-10-04 17:35:40 UTC) #6
iannucci
tests next. A failed check now looks like: 'engine_tests/whitelist_steps.all_steps' failed checks! CHECK(FAIL) - "something was ...
4 years, 2 months ago (2016-10-06 20:28:10 UTC) #7
dnj
https://codereview.chromium.org/2387763003/diff/1/recipe_engine/simulation_test.py File recipe_engine/simulation_test.py (right): https://codereview.chromium.org/2387763003/diff/1/recipe_engine/simulation_test.py#newcode48 recipe_engine/simulation_test.py:48: for i in range(lineno-1, 0, -1): On 2016/10/04 16:42:35, ...
4 years, 2 months ago (2016-10-06 21:20:20 UTC) #8
martiniss
On 2016/10/06 at 20:28:10, iannucci wrote: > tests next. A failed check now looks like: ...
4 years, 2 months ago (2016-10-06 21:24:15 UTC) #9
iannucci
ok, got the rest of the comments, going to get lunch then do tests. https://codereview.chromium.org/2387763003/diff/1/recipe_engine/simulation_test.py ...
4 years, 2 months ago (2016-10-06 22:47:12 UTC) #10
Michael Achenbach
Thanks a lot for working on this! https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/recipe_test_api.py File recipe_engine/recipe_test_api.py (right): https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/recipe_test_api.py#newcode601 recipe_engine/recipe_test_api.py:601: The function ...
4 years, 2 months ago (2016-10-07 16:32:04 UTC) #11
Michael Achenbach
https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/recipe_test_api.py File recipe_engine/recipe_test_api.py (right): https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/recipe_test_api.py#newcode606 recipe_engine/recipe_test_api.py:606: the unmodified step_odict. Your function is never permitted to ...
4 years, 2 months ago (2016-10-07 16:43:54 UTC) #12
Michael Achenbach
https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py File recipe_engine/post_process.py (right): https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py#newcode95 recipe_engine/post_process.py:95: new_data = self.data.copy() Why not mutate self.data as well ...
4 years, 2 months ago (2016-10-07 16:51:30 UTC) #13
Michael Achenbach
https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py File recipe_engine/post_process.py (right): https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py#newcode95 recipe_engine/post_process.py:95: new_data = self.data.copy() On 2016/10/07 16:51:30, machenbach (slow) wrote: ...
4 years, 2 months ago (2016-10-07 16:54:40 UTC) #14
Michael Achenbach
https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py File recipe_engine/post_process.py (right): https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py#newcode147 recipe_engine/post_process.py:147: check(not r.match(step_name)) nit: Should these canned checks not get ...
4 years, 2 months ago (2016-10-07 16:56:42 UTC) #15
iannucci
On 2016/10/07 16:51:30, machenbach (slow) wrote: > https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py > File recipe_engine/post_process.py (right): > > https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py#newcode95 ...
4 years, 2 months ago (2016-10-07 22:55:31 UTC) #16
iannucci
On 2016/10/07 16:56:42, machenbach (slow) wrote: > https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py > File recipe_engine/post_process.py (right): > > https://codereview.chromium.org/2387763003/diff/100001/recipe_engine/post_process.py#newcode147 ...
4 years, 2 months ago (2016-10-07 22:57:06 UTC) #17
Michael Achenbach
Awesome, lgtm from a consumer p-o-v. I didn't check the implementation in much detail, please ...
4 years, 2 months ago (2016-10-08 09:02:01 UTC) #18
martiniss
On 2016/10/08 at 09:02:01, machenbach wrote: > Awesome, lgtm from a consumer p-o-v. I didn't ...
4 years, 2 months ago (2016-10-10 17:05:59 UTC) #19
iannucci
On 2016/10/10 17:05:59, martiniss wrote: > On 2016/10/08 at 09:02:01, machenbach wrote: > > Awesome, ...
4 years, 2 months ago (2016-10-10 18:15:02 UTC) #20
martiniss
Are you done with this CL? More tests coming, right? Looks generally good :) https://codereview.chromium.org/2387763003/diff/120001/recipe_engine/checker.py ...
4 years, 2 months ago (2016-10-10 18:53:12 UTC) #21
iannucci
Ok, PTAL for real. I've actually addressed all comments, added docs and tests, and ended ...
4 years, 2 months ago (2016-10-13 01:17:22 UTC) #22
Michael Achenbach
Still lgtm from user perspective. Only skimmed through the api and tests and left a ...
4 years, 2 months ago (2016-10-13 07:45:08 UTC) #23
iannucci
PTAL https://chromiumcodereview.appspot.com/2387763003/diff/180001/recipe_engine/checker.py File recipe_engine/checker.py (right): https://chromiumcodereview.appspot.com/2387763003/diff/180001/recipe_engine/checker.py#newcode1 recipe_engine/checker.py:1: # Copyright 2014 The LUCI Authors. All rights ...
4 years, 2 months ago (2016-10-13 22:03:21 UTC) #24
martiniss
lgtm https://codereview.chromium.org/2387763003/diff/120001/recipe_engine/checker.py File recipe_engine/checker.py (right): https://codereview.chromium.org/2387763003/diff/120001/recipe_engine/checker.py#newcode260 recipe_engine/checker.py:260: elif len(a) == 1: On 2016/10/10 18:53:12, martiniss ...
4 years, 2 months ago (2016-10-13 22:54:13 UTC) #26
iannucci
https://chromiumcodereview.appspot.com/2387763003/diff/200001/recipe_engine/checker.py File recipe_engine/checker.py (right): https://chromiumcodereview.appspot.com/2387763003/diff/200001/recipe_engine/checker.py#newcode61 recipe_engine/checker.py:61: restrict this to Compare ops with a single operator ...
4 years, 2 months ago (2016-10-13 23:05:05 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2387763003/240001
4 years, 2 months ago (2016-10-13 23:35:06 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: Recipes-py Presubmit on luci.infra.try (JOB_FAILED, https://luci-milo.appspot.com/swarming/task/31d937e022cd1010)
4 years, 2 months ago (2016-10-13 23:37:55 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2387763003/260001
4 years, 2 months ago (2016-10-13 23:55:44 UTC) #35
commit-bot: I haz the power
4 years, 2 months ago (2016-10-14 00:01:05 UTC) #37
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://github.com/luci/recipes-py/commit/d97fe4474b8ebefb906e594aba840fff587...

Powered by Google App Engine
This is Rietveld 408576698