Convert recipe_modules expectation tests

Converts all remaining recipe_modules expectation-based tests to be
assert/post_process-based.

Bug: 1418547
Change-Id: I0f45c92a4f682edcf186b5202ec2001475d04bec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4288230
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
changes/30/4288230/4
Brian Sheedy 2 years ago committed by LUCI CQ
parent 58da0c8284
commit fce87337b1

@ -810,13 +810,13 @@ Returns current gerrit change, if there is exactly one.
Returns a self.m.buildbucket.common_pb2.GerritChange or None. Returns a self.m.buildbucket.common_pb2.GerritChange or None.
&emsp; **@property**<br>&mdash; **def [gerrit\_change\_fetch\_ref](/recipes/recipe_modules/tryserver/api.py#157)(self):** &emsp; **@property**<br>&mdash; **def [gerrit\_change\_fetch\_ref](/recipes/recipe_modules/tryserver/api.py#158)(self):**
Returns gerrit patch ref, e.g. "refs/heads/45/12345/6, or None. Returns gerrit patch ref, e.g. "refs/heads/45/12345/6, or None.
Populated iff gerrit_change is populated. Populated iff gerrit_change is populated.
&emsp; **@property**<br>&mdash; **def [gerrit\_change\_number](/recipes/recipe_modules/tryserver/api.py#175)(self):** &emsp; **@property**<br>&mdash; **def [gerrit\_change\_number](/recipes/recipe_modules/tryserver/api.py#176)(self):**
Returns gerrit change patchset, e.g. 12345 for a patch ref of Returns gerrit change patchset, e.g. 12345 for a patch ref of
"refs/heads/45/12345/6". "refs/heads/45/12345/6".
@ -848,24 +848,24 @@ Returns canonical URL of the gitiles repo of the current Gerrit CL.
Populated iff gerrit_change is populated. Populated iff gerrit_change is populated.
&emsp; **@property**<br>&mdash; **def [gerrit\_change\_review\_url](/recipes/recipe_modules/tryserver/api.py#97)(self):** &emsp; **@property**<br>&mdash; **def [gerrit\_change\_review\_url](/recipes/recipe_modules/tryserver/api.py#98)(self):**
Returns the review URL for the active patchset. Returns the review URL for the active patchset.
&emsp; **@property**<br>&mdash; **def [gerrit\_change\_target\_ref](/recipes/recipe_modules/tryserver/api.py#166)(self):** &emsp; **@property**<br>&mdash; **def [gerrit\_change\_target\_ref](/recipes/recipe_modules/tryserver/api.py#167)(self):**
Returns gerrit change destination ref, e.g. "refs/heads/main". Returns gerrit change destination ref, e.g. "refs/heads/main".
Populated iff gerrit_change is populated. Populated iff gerrit_change is populated.
&emsp; **@property**<br>&mdash; **def [gerrit\_patchset\_number](/recipes/recipe_modules/tryserver/api.py#187)(self):** &emsp; **@property**<br>&mdash; **def [gerrit\_patchset\_number](/recipes/recipe_modules/tryserver/api.py#188)(self):**
Returns gerrit change patchset, e.g. 6 for a patch ref of Returns gerrit change patchset, e.g. 6 for a patch ref of
"refs/heads/45/12345/6". "refs/heads/45/12345/6".
Populated iff gerrit_change is populated Returns None if not populated.. Populated iff gerrit_change is populated Returns None if not populated..
&mdash; **def [get\_files\_affected\_by\_patch](/recipes/recipe_modules/tryserver/api.py#233)(self, patch_root, report_files_via_property=None, \*\*kwargs):** &mdash; **def [get\_files\_affected\_by\_patch](/recipes/recipe_modules/tryserver/api.py#234)(self, patch_root, report_files_via_property=None, \*\*kwargs):**
Returns list of paths to files affected by the patch. Returns list of paths to files affected by the patch.
@ -877,11 +877,11 @@ Args:
Returned paths will be relative to to api.path['root']. Returned paths will be relative to to api.path['root'].
&mdash; **def [get\_footer](/recipes/recipe_modules/tryserver/api.py#375)(self, tag, patch_text=None):** &mdash; **def [get\_footer](/recipes/recipe_modules/tryserver/api.py#376)(self, tag, patch_text=None):**
Gets a specific tag from a CL description Gets a specific tag from a CL description
&mdash; **def [get\_footers](/recipes/recipe_modules/tryserver/api.py#337)(self, patch_text=None):** &mdash; **def [get\_footers](/recipes/recipe_modules/tryserver/api.py#338)(self, patch_text=None):**
Retrieves footers from the patch description. Retrieves footers from the patch description.
@ -890,32 +890,32 @@ git-footers documentation for more information.
&mdash; **def [initialize](/recipes/recipe_modules/tryserver/api.py#42)(self):** &mdash; **def [initialize](/recipes/recipe_modules/tryserver/api.py#42)(self):**
&emsp; **@property**<br>&mdash; **def [is\_gerrit\_issue](/recipes/recipe_modules/tryserver/api.py#204)(self):** &emsp; **@property**<br>&mdash; **def [is\_gerrit\_issue](/recipes/recipe_modules/tryserver/api.py#205)(self):**
Returns true iff the properties exist to match a Gerrit issue. Returns true iff the properties exist to match a Gerrit issue.
&emsp; **@property**<br>&mdash; **def [is\_patch\_in\_git](/recipes/recipe_modules/tryserver/api.py#214)(self):** &emsp; **@property**<br>&mdash; **def [is\_patch\_in\_git](/recipes/recipe_modules/tryserver/api.py#215)(self):**
&emsp; **@property**<br>&mdash; **def [is\_tryserver](/recipes/recipe_modules/tryserver/api.py#199)(self):** &emsp; **@property**<br>&mdash; **def [is\_tryserver](/recipes/recipe_modules/tryserver/api.py#200)(self):**
Returns true iff we have a change to check out. Returns true iff we have a change to check out.
&mdash; **def [normalize\_footer\_name](/recipes/recipe_modules/tryserver/api.py#383)(self, footer):** &mdash; **def [normalize\_footer\_name](/recipes/recipe_modules/tryserver/api.py#384)(self, footer):**
&mdash; **def [require\_is\_tryserver](/recipes/recipe_modules/tryserver/api.py#220)(self):** &mdash; **def [require\_is\_tryserver](/recipes/recipe_modules/tryserver/api.py#221)(self):**
&mdash; **def [set\_change](/recipes/recipe_modules/tryserver/api.py#386)(self, change):** &mdash; **def [set\_change](/recipes/recipe_modules/tryserver/api.py#387)(self, change):**
Set the gerrit change for this module. Set the gerrit change for this module.
Args: Args:
* change: a self.m.buildbucket.common_pb2.GerritChange. * change: a self.m.buildbucket.common_pb2.GerritChange.
&mdash; **def [set\_compile\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#298)(self):** &mdash; **def [set\_compile\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#299)(self):**
Mark the tryjob result as a compile failure. Mark the tryjob result as a compile failure.
&mdash; **def [set\_invalid\_test\_results\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#310)(self):** &mdash; **def [set\_invalid\_test\_results\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#311)(self):**
Mark the tryjob result as having invalid test results. Mark the tryjob result as having invalid test results.
@ -923,32 +923,32 @@ This means we run some tests, but the results were not valid
(e.g. no list of specific test cases that failed, or too many (e.g. no list of specific test cases that failed, or too many
tests failing, etc). tests failing, etc).
&mdash; **def [set\_patch\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#294)(self):** &mdash; **def [set\_patch\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#295)(self):**
Mark the tryjob result as failure to apply the patch. Mark the tryjob result as failure to apply the patch.
&mdash; **def [set\_subproject\_tag](/recipes/recipe_modules/tryserver/api.py#272)(self, subproject_tag):** &mdash; **def [set\_subproject\_tag](/recipes/recipe_modules/tryserver/api.py#273)(self, subproject_tag):**
Adds a subproject tag to the build. Adds a subproject tag to the build.
This can be used to distinguish between builds that execute different steps This can be used to distinguish between builds that execute different steps
depending on what was patched, e.g. blink vs. pure chromium patches. depending on what was patched, e.g. blink vs. pure chromium patches.
&mdash; **def [set\_test\_expired\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#327)(self):** &mdash; **def [set\_test\_expired\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#328)(self):**
Mark the tryjob result as a test expiration. Mark the tryjob result as a test expiration.
This means a test task expired and was never scheduled, most likely due to This means a test task expired and was never scheduled, most likely due to
lack of capacity. lack of capacity.
&mdash; **def [set\_test\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#302)(self):** &mdash; **def [set\_test\_failure\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#303)(self):**
Mark the tryjob result as a test failure. Mark the tryjob result as a test failure.
This means we started running actual tests (not prerequisite steps This means we started running actual tests (not prerequisite steps
like checkout or compile), and some of these tests have failed. like checkout or compile), and some of these tests have failed.
&mdash; **def [set\_test\_timeout\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#319)(self):** &mdash; **def [set\_test\_timeout\_tryjob\_result](/recipes/recipe_modules/tryserver/api.py#320)(self):**
Mark the tryjob result as a test timeout. Mark the tryjob result as a test timeout.
@ -1043,11 +1043,11 @@ PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/examples/full.py#67)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/gclient/examples/full.py#67)(api):**
### *recipes* / [gclient:tests/diff\_deps](/recipes/recipe_modules/gclient/tests/diff_deps.py) ### *recipes* / [gclient:tests/diff\_deps](/recipes/recipe_modules/gclient/tests/diff_deps.py)
[DEPS](/recipes/recipe_modules/gclient/tests/diff_deps.py#9): [gclient](#recipe_modules-gclient), [recipe\_engine/assertions][recipe_engine/recipe_modules/assertions], [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io] [DEPS](/recipes/recipe_modules/gclient/tests/diff_deps.py#10): [gclient](#recipe_modules-gclient), [recipe\_engine/assertions][recipe_engine/recipe_modules/assertions], [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io]
PYTHON_VERSION_COMPATIBILITY: PY3 PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/gclient/tests/diff_deps.py#20)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/gclient/tests/diff_deps.py#21)(api):**
### *recipes* / [gclient:tests/patch\_project](/recipes/recipe_modules/gclient/tests/patch_project.py) ### *recipes* / [gclient:tests/patch\_project](/recipes/recipe_modules/gclient/tests/patch_project.py)
[DEPS](/recipes/recipe_modules/gclient/tests/patch_project.py#11): [gclient](#recipe_modules-gclient), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties] [DEPS](/recipes/recipe_modules/gclient/tests/patch_project.py#11): [gclient](#recipe_modules-gclient), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
@ -1099,11 +1099,11 @@ PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/gitiles/examples/full.py#16)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/gitiles/examples/full.py#16)(api):**
### *recipes* / [gitiles:tests/parse\_repo\_url](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py) ### *recipes* / [gitiles:tests/parse\_repo\_url](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py)
[DEPS](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py#7): [gitiles](#recipe_modules-gitiles), [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step] [DEPS](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py#9): [gitiles](#recipe_modules-gitiles), [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3 PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py#14)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/gitiles/tests/parse_repo_url.py#16)(api):**
### *recipes* / [gsutil:examples/custom\_boto](/recipes/recipe_modules/gsutil/examples/custom_boto.py) ### *recipes* / [gsutil:examples/custom\_boto](/recipes/recipe_modules/gsutil/examples/custom_boto.py)
[DEPS](/recipes/recipe_modules/gsutil/examples/custom_boto.py#10): [gsutil](#recipe_modules-gsutil), [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties] [DEPS](/recipes/recipe_modules/gsutil/examples/custom_boto.py#10): [gsutil](#recipe_modules-gsutil), [recipe\_engine/platform][recipe_engine/recipe_modules/platform], [recipe\_engine/properties][recipe_engine/recipe_modules/properties]
@ -1164,11 +1164,11 @@ PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py#17)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_fetch_ref_timeout.py#17)(api):**
### *recipes* / [tryserver:tests/gerrit\_change\_owner](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py) ### *recipes* / [tryserver:tests/gerrit\_change\_owner](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py)
[DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py#9): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket] [DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py#10): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/step][recipe_engine/recipe_modules/step]
PYTHON_VERSION_COMPATIBILITY: PY3 PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py#16)(api):** &mdash; **def [RunSteps](/recipes/recipe_modules/tryserver/tests/gerrit_change_owner.py#18)(api):**
### *recipes* / [tryserver:tests/gerrit\_change\_target\_ref](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py) ### *recipes* / [tryserver:tests/gerrit\_change\_target\_ref](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py)
[DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py#9): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step] [DEPS](/recipes/recipe_modules/tryserver/tests/gerrit_change_target_ref.py#9): [gerrit](#recipe_modules-gerrit), [tryserver](#recipe_modules-tryserver), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]

@ -1,95 +0,0 @@
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD~",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the previous DEPS"
},
{
"cmd": [
"vpython3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
]
},
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "gclient recursively git diff all DEPS",
"~followup_annotations": [
"@@@STEP_LOG_LINE@raw_io.output_text@10>third_party/mockfile1@@@",
"@@@STEP_LOG_LINE@raw_io.output_text@10>third_party/mockfile2@@@",
"@@@STEP_LOG_END@raw_io.output_text@@@"
]
},
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the original DEPS"
},
{
"name": "$result"
}
]

@ -1,114 +0,0 @@
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD~",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the previous DEPS"
},
{
"cmd": [
"vpython3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
]
},
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "gclient recursively git diff all DEPS",
"~followup_annotations": [
"@@@STEP_LOG_LINE@raw_io.output_text@fatal: bad object abcdef1234567890@@@",
"@@@STEP_LOG_END@raw_io.output_text@@@",
"@@@STEP_LOG_LINE@DepsDiffException@Couldn't checkout previous ref: fatal: bad object abcdef1234567890@@@",
"@@@STEP_LOG_END@DepsDiffException@@@"
]
},
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the original DEPS"
},
{
"cmd": [],
"name": "RECIPE CRASH (Uncaught exception)",
"~followup_annotations": [
"@@@STEP_EXCEPTION@@@",
"The recipe has crashed at point 'Uncaught exception'!",
"",
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 35, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 396, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException('Couldn't checkout previous ref: fatal: bad object abcdef1234567890')"
]
},
{
"failure": {
"humanReason": "Uncaught Exception: DepsDiffException('Couldn't checkout previous ref: fatal: bad object abcdef1234567890')"
},
"name": "$result"
}
]

@ -1,113 +0,0 @@
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD~",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the previous DEPS"
},
{
"cmd": [
"vpython3",
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
]
},
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "gclient recursively git diff all DEPS",
"~followup_annotations": [
"@@@STEP_LOG_END@raw_io.output_text@@@",
"@@@STEP_LOG_LINE@DepsDiffException@Unexpected result: autoroll diff found 0 files changed@@@",
"@@@STEP_LOG_END@DepsDiffException@@@"
]
},
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the original DEPS"
},
{
"cmd": [],
"name": "RECIPE CRASH (Uncaught exception)",
"~followup_annotations": [
"@@@STEP_EXCEPTION@@@",
"The recipe has crashed at point 'Uncaught exception'!",
"",
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 35, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 412, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException('Unexpected result: autoroll diff found 0 files changed')"
]
},
{
"failure": {
"humanReason": "Uncaught Exception: DepsDiffException('Unexpected result: autoroll diff found 0 files changed')"
},
"name": "$result"
}
]

@ -1,95 +0,0 @@
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD~",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the previous DEPS"
},
{
"cmd": [
"vpython3",
"-u",
"RECIPE_REPO[depot_tools]\\gclient.py",
"recurse",
"python3",
"RECIPE_MODULE[depot_tools::gclient]\\resources\\diff_deps.py"
],
"cwd": "[CACHE]",
"env": {
"DEPOT_TOOLS_REPORT_BUILD": "project/try/builder/8945511751514863184"
},
"env_suffixes": {
"PATH": [
"RECIPE_REPO[depot_tools]"
]
},
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "gclient recursively git diff all DEPS",
"~followup_annotations": [
"@@@STEP_LOG_LINE@raw_io.output_text@10>third_party/mockfile1@@@",
"@@@STEP_LOG_LINE@raw_io.output_text@10>third_party/mockfile2@@@",
"@@@STEP_LOG_END@raw_io.output_text@@@"
]
},
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"checkout",
"HEAD",
"--",
"DEPS"
],
"cwd": "[CACHE]",
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "checkout the original DEPS"
},
{
"name": "$result"
}
]

@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from recipe_engine import post_process from recipe_engine.post_process import (DropExpectation, StatusSuccess,
SummaryMarkdown)
PYTHON_VERSION_COMPATIBILITY = 'PY2+3' PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
@ -54,7 +55,8 @@ def GenTests(api):
'gclient recursively git diff all DEPS', 'gclient recursively git diff all DEPS',
api.gclient.diff_deps_test_data(test_files), api.gclient.diff_deps_test_data(test_files),
), ),
api.post_process(post_process.StatusSuccess), api.post_process(StatusSuccess),
api.post_process(DropExpectation),
) )
yield api.test( yield api.test(
@ -65,8 +67,14 @@ def GenTests(api):
'gclient recursively git diff all DEPS', 'gclient recursively git diff all DEPS',
api.gclient.diff_deps_test_data(no_test_files), api.gclient.diff_deps_test_data(no_test_files),
), ),
api.expect_exception('DepsDiffException') api.expect_exception('DepsDiffException'),
api.post_process(
SummaryMarkdown,
"Uncaught Exception: DepsDiffException('Unexpected result: autoroll "
"diff found 0 files changed')"),
api.post_process(DropExpectation),
) )
yield api.test( yield api.test(
'dont have revision yet', 'dont have revision yet',
api.buildbucket.try_build(), api.buildbucket.try_build(),
@ -75,8 +83,14 @@ def GenTests(api):
'gclient recursively git diff all DEPS', 'gclient recursively git diff all DEPS',
api.raw_io.stream_output_text('fatal: bad object abcdef1234567890'), api.raw_io.stream_output_text('fatal: bad object abcdef1234567890'),
), ),
api.expect_exception('DepsDiffException') api.expect_exception('DepsDiffException'),
api.post_process(
SummaryMarkdown,
"Uncaught Exception: DepsDiffException('Couldn't checkout previous "
"ref: fatal: bad object abcdef1234567890')"),
api.post_process(DropExpectation),
) )
yield api.test( yield api.test(
'windows', 'windows',
api.buildbucket.try_build(), api.buildbucket.try_build(),
@ -86,5 +100,6 @@ def GenTests(api):
'gclient recursively git diff all DEPS', 'gclient recursively git diff all DEPS',
api.gclient.diff_deps_test_data(test_files), api.gclient.diff_deps_test_data(test_files),
), ),
api.post_process(post_process.StatusSuccess), api.post_process(StatusSuccess),
api.post_process(DropExpectation),
) )

@ -2,6 +2,8 @@
# Use of this source code is governed under the Apache License, Version 2.0 # Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file. # that can be found in the LICENSE file.
from recipe_engine.post_process import DropExpectation, StatusSuccess
PYTHON_VERSION_COMPATIBILITY = 'PY2+3' PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [ DEPS = [
@ -48,4 +50,8 @@ def RunSteps(api):
def GenTests(api): def GenTests(api):
yield api.test('basic') yield api.test(
'basic',
api.post_process(StatusSuccess),
api.post_process(DropExpectation),
)

@ -92,6 +92,7 @@ class TryserverApi(recipe_api.RecipeApi):
Populated iff gerrit_change is populated. Populated iff gerrit_change is populated.
Is a dictionary with keys like "name". Is a dictionary with keys like "name".
""" """
self._ensure_gerrit_change_info()
return self._gerrit_change_owner return self._gerrit_change_owner
@property @property

@ -2,23 +2,30 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
from recipe_engine import post_process from recipe_engine.post_process import (DropExpectation, StatusSuccess,
StepCommandContains)
PYTHON_VERSION_COMPATIBILITY = 'PY2+3' PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [ DEPS = [
'recipe_engine/buildbucket',
'gerrit', 'gerrit',
'tryserver', 'tryserver',
'recipe_engine/buildbucket',
'recipe_engine/step',
] ]
def RunSteps(api): def RunSteps(api):
api.tryserver.gerrit_change_owner api.step(name='print owner',
cmd=['echo', str(api.tryserver.gerrit_change_owner)])
def GenTests(api): def GenTests(api):
yield api.test( yield api.test(
'basic', 'basic',
api.buildbucket.try_build() api.buildbucket.try_build(),
api.post_process(StepCommandContains, 'print owner',
['echo', "OrderedDict([('name', 'John Doe')])"]),
api.post_process(StatusSuccess),
api.post_process(DropExpectation),
) )

@ -1,24 +0,0 @@
[
{
"cmd": [
"git",
"-c",
"core.quotePath=false",
"diff",
"--cached",
"--name-only"
],
"cwd": "[START_DIR]/test/patch/root",
"infra_step": true,
"name": "git diff to analyze patch",
"~followup_annotations": [
"@@@STEP_LOG_LINE@files@test/patch/root/baz/shaz.cc@@@",
"@@@STEP_LOG_LINE@files@test/patch/root/foo/bar.cc@@@",
"@@@STEP_LOG_END@files@@@",
"@@@SET_BUILD_PROPERTY@affected-files@{\"first_100\": [\"test/patch/root/baz/shaz.cc\", \"test/patch/root/foo/bar.cc\"], \"total_count\": 2}@@@"
]
},
{
"name": "$result"
}
]

@ -73,6 +73,7 @@ def GenTests(api):
], ],
), ),
api.post_check(post_process.StatusSuccess), api.post_check(post_process.StatusSuccess),
api.post_process(post_process.DropExpectation),
) )
yield api.test( yield api.test(

Loading…
Cancel
Save