Closed
Bug 487496
Opened 14 years ago
Closed 14 years ago
custom BuildStep's need to explicitly name arguments and call self.addFactoryArguments
Categories
(Release Engineering :: General, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bhearsum, Assigned: bhearsum)
References
Details
Attachments
(5 files, 3 obsolete files)
26.26 KB,
patch
|
catlee
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
25.42 KB,
patch
|
catlee
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
1.68 KB,
patch
|
coop
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
1.17 KB,
patch
|
coop
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
13.81 KB,
patch
|
catlee
:
review+
bhearsum
:
checked-in+
|
Details | Diff | Splinter Review |
Particularly, 0.7.10p1 includes http://github.com/djmitche/buildbot/commit/071564761f46ea7089bbd6301589eeb466c3ec31, which removes **kwargs from RemoteShellCommand. This has caused all of our ShellCommand subclasses which do not explicitly name arguments to throw exceptions such as: <type 'exceptions.TypeError'>: __init__() got an unexpected keyword argument 'clobber' We've got some of these to fix in at least unittest/steps.py and steps/test.py. Maybe elsewhere, too.
Comment 1•14 years ago
|
||
We should also make sure we're setting the factory arguments properly
Assignee | ||
Comment 2•14 years ago
|
||
(In reply to comment #1) > We should also make sure we're setting the factory arguments properly Good point. I'll fix the summary to include that
Summary: custom BuildStep's need to explicitly name arguments rather than using **kwargs → custom BuildStep's need to explicitly name arguments and call self.addFactoryArguments
Assignee | ||
Updated•14 years ago
|
Priority: -- → P2
Assignee | ||
Comment 3•14 years ago
|
||
I've tested this pretty extensively on staging-master and staging-try-master and this should get them working with 0.7.10p1. We might need to test patch perfmaster.py, but I'll be testing that next week. I haven't explicitly tested any release things, but there's only one BuildStep that's only used there AFAIK. Given that the rest of these changes fixed up leak tests/unittests/etc. I'm pretty confident in us having no issues there. I haven't explicitly run an en-US nightly either, but that doesn't use any different steps, just a different code path in the BuildFactory. Here's a summary of what I've actually changed: * Stop passing the non-existent argument 'clobber' to CreateProfile. * Move all addFactoryArguments statements to directly below superclass for consistency * Use addFactoryArguments in all BuildStep subclasses * Explicitly name all arguments in the constructors, don't let them end up in **kwargs anymore * Remove unnecessary explicit passing of 'repourl' in some places * Fix indentation in unittest/steps.py (bad \t's!) No rush on this patch - I won't be ready to land it until at least mid next week.
Attachment #371947 -
Flags: review?(catlee)
Updated•14 years ago
|
Attachment #371947 -
Flags: review?(catlee) → review+
Comment 4•14 years ago
|
||
Comment on attachment 371947 [details] [diff] [review] [WIP] fix parameter passing in buildbotcustom BuildStep subclasses There are a few instances of kwargs['command'] left in here that I'd love to see go away.
Assignee | ||
Comment 5•14 years ago
|
||
Basically the same as before, but I got rid of the kwargs usage in test.py, tryserver/steps.py, and unittest/steps.py. I didn't touch any of the clobber file stuff in unittest/steps.py - it's only used by the 1.9 master and didn't feel it was worth the effort.
Attachment #371947 -
Attachment is obsolete: true
Attachment #372613 -
Flags: review?(catlee)
Assignee | ||
Comment 6•14 years ago
|
||
This is the same thing as the other patch, but for Talos. I've tested the talos-staging/ code and other than me missing a class on the first pass, I've had no issues with it. It's currently running on http://qm-buildbot01.mozilla.org:2008/waterfall, if you'd like to see for yourself. I don't think we have a try talos staging area...so I'm not sure I can test those. After all of my testing of the first patch, plus how smoothly testing of this one went, I'm pretty confident in it, though.
Attachment #372642 -
Flags: review?(catlee)
Updated•14 years ago
|
Attachment #372642 -
Flags: review?(catlee) → review-
Comment 7•14 years ago
|
||
Comment on attachment 372642 [details] [diff] [review] explicit parameters and removal of kwargs manipulation for talos >+ def __init__(self, branch="HEAD", command=["wget"], **kwargs): Don't use lists as the default value for function arguments. This will probably come back to bite us later.
Updated•14 years ago
|
Attachment #372613 -
Flags: review?(catlee) → review+
Assignee | ||
Comment 8•14 years ago
|
||
The metadiff for this is big....but there's not much going on.
Attachment #372642 -
Attachment is obsolete: true
Attachment #372665 -
Flags: review?(catlee)
Updated•14 years ago
|
Attachment #372665 -
Flags: review?(catlee) → review+
Assignee | ||
Updated•14 years ago
|
Attachment #372613 -
Flags: checked‑in+
Assignee | ||
Comment 9•14 years ago
|
||
Comment on attachment 372613 [details] [diff] [review] get rid of some more kwargs changeset: 251:153cc725f37c
Assignee | ||
Comment 10•14 years ago
|
||
(In reply to comment #9) > (From update of attachment 372613 [details] [diff] [review]) > changeset: 251:153cc725f37c I reconfig'ed production-master and try-master for this.
Comment 11•14 years ago
|
||
Comment on attachment 372613 [details] [diff] [review] get rid of some more kwargs >diff -r 6a71c76fd77a unittest/steps.py (I checked this file only...) >@@ -237,8 +235,8 @@ >- self.super_class = ShellCommandReportTimeout >- ShellCommandReportTimeout.__init__(self, **kwargs) >+ self.super_class = ShellCommandReportTimeout >+ ShellCommandReportTimeout.__init__(self, **kwargs) Doesn't MozillaCheck.__init__() miss |self.addFactoryArguments(test_name=test_name)|? >@@ -284,12 +282,14 @@ > def __init__(self, test_name, **kwargs): >+ ShellCommandReportTimeout.__init__(self, **kwargs) >+ self.addFactoryArguments(test_name=test_name) >+ > self.name = test_name > self.command = ["make", test_name] > self.description = [test_name + " test"] > self.descriptionDone = [self.description[0] + " complete"] >- self.super_class = ShellCommandReportTimeout >- ShellCommandReportTimeout.__init__(self, **kwargs) >+ self.super_class = ShellCommandReportTimeout Why did you move ShellCommandReportTimeout.__init__() up (for Reftest and Mochitest only)? I'm not sure whether it should be at the start or the end, but it feels odd not to be the same everywhere. >@@ -348,18 +348,17 @@ > class MozillaMochitest(ShellCommandReportTimeout): > warnOnFailure = True > >- def __init__(self, test_name, leakThreshold=None, **kwargs): >+ def __init__(self, test_name, leakThreshold=None, env={}, **kwargs): >+ ShellCommandReportTimeout.__init__(self, env=env, **kwargs) >+ self.super_class = ShellCommandReportTimeout >+ self.addFactoryArguments(test_name=test_name, >+ leakThreshold=leakThreshold) Shouldn't addFactoryArguments() have |env=env| too?
Comment 12•14 years ago
|
||
Comment on attachment 372613 [details] [diff] [review] get rid of some more kwargs >diff -r 6a71c76fd77a unittest/steps.py >@@ -115,22 +117,18 @@ > class MozillaClientMkPull(ShellCommandReportTimeout): >+ env = env.copy() >+ env["MOZ_CO_PROJECT"] = self.project >+ ShellCommandReportTimeout.__init__(self, command=command, env=env, >+ **kwargs) >+ self.addFactoryArguments(project=project, workdir=workdir, env=env, >+ command=command) >@@ -348,18 +348,17 @@ > class MozillaMochitest(ShellCommandReportTimeout): >+ ShellCommandReportTimeout.__init__(self, env=env, **kwargs) Isn't is broken to call before setting env["EXTRA_TEST_ARGS"]? >+ self.env["EXTRA_TEST_ARGS"] = "--leak-threshold=%d" % leakThreshold I'm not sure why you use |env| for MozillaClientMkPull and |self.env| for MozillaMochitest? I'm not sure which one is "better", but it feels odd to be different...
Assignee | ||
Comment 13•14 years ago
|
||
(In reply to comment #11) > (From update of attachment 372613 [details] [diff] [review]) > Doesn't MozillaCheck.__init__() miss > |self.addFactoryArguments(test_name=test_name)|? > Yeah, looks like that patch landed after I went through this file. > Why did you move ShellCommandReportTimeout.__init__() up (for Reftest and > Mochitest only)? > I'm not sure whether it should be at the start or the end, > but it feels odd not to be the same everywhere. > I've moved it to the start wherever possible. In functions where the __init__ method does things that require the parent class __init__ not to have run yet I've moved or left it at the bottom. In both cases I've kept the parent class __init__ call and addFactoryArguments together. > >@@ -348,18 +348,17 @@ > > class MozillaMochitest(ShellCommandReportTimeout): > Shouldn't addFactoryArguments() have |env=env| too? Yes, you're absolutely right. > Isn't is broken to call before setting env["EXTRA_TEST_ARGS"]? > No, in this scenario self.env is guaranteed to exist. However, you just made me realize that the same bug I spoke of in the reftest leak threshold bug exists here.
Assignee: bhearsum → nobody
Assignee | ||
Comment 14•14 years ago
|
||
(thank you for unassigning me, bugzilla)
Assignee: nobody → bhearsum
Assignee | ||
Comment 15•14 years ago
|
||
This fixes the missing test_name parameter in MozillaCheck, and fixes MozillaMochitest so that the passed in environment is kept. The only reason didn't break (AFAICT) is because I forgot to pass env in addFactoryArguments, so when the Build object was created it ended up getting the env from buildbotcustom anyways...
Attachment #373694 -
Flags: review?(ccooper)
Comment 16•14 years ago
|
||
Comment on attachment 373694 [details] [diff] [review] followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug >+ def __init__(self, test_name, leakThreshold=None, **kwargs): If you do want to s/None/0/, now is the time...
Comment 17•14 years ago
|
||
(In reply to comment #13) > > Why did you move ShellCommandReportTimeout.__init__() up (for Reftest and > > Mochitest only)? > I've moved it to the start wherever possible. Well, only Reftest and Mochitest have it at the start (now). > In functions where the __init__ > method does things that require the parent class __init__ not to have run yet > I've moved or left it at the bottom. Well, I understand what you write, but I don't understand what these two classes have different than the others (wrt what their __init__() do), MozillaCheck for example. > In both cases I've kept the parent class > __init__ call and addFactoryArguments together. (No problem with that.) > > Isn't is broken to call before setting env["EXTRA_TEST_ARGS"]? > > No, in this scenario self.env is guaranteed to exist. However, you just made me > realize that the same bug I spoke of in the reftest leak threshold bug exists > here. Maybe I'm just confused by the other issues: let's fix them first...
Comment 18•14 years ago
|
||
Comment on attachment 372613 [details] [diff] [review] get rid of some more kwargs >diff -r 6a71c76fd77a steps/release.py >@@ -25,6 +25,9 @@ >+ self.addFactoryArguments(currentProduct=currentProduct, >+ previousProduct=previousProduct) Please double check, as not all the code is visible in the patch. >diff -r 6a71c76fd77a tryserver/steps.py >@@ -184,7 +183,8 @@ >+ def __init__(self, isOptional=False, patchDir=".", workdir="build", >+ **kwargs): >@@ -196,13 +196,12 @@ >+ self.addFactoryArguments(isOptional=isOptional, patchDir=patchDir) Misses workdir? >@@ -278,10 +278,7 @@ > def __init__(self, baseURL="http://hg.mozilla.org/", >+ defaultBranch='mozilla-central', timeout=3600, **kwargs): Please double check, as not all the code is visible in the patch. >@@ -303,13 +300,13 @@ >+ def __init__(self, cvsroot, workdir=".", **kwargs): >+ self.addFactoryArguments(cvsroot=cvsroot) Misses workdir?
Comment 19•14 years ago
|
||
Comment on attachment 373694 [details] [diff] [review] followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug See my 2 remaining "nits" in bug 469518 comment 45.
Updated•14 years ago
|
Attachment #373694 -
Flags: review?(ccooper) → review+
Comment 20•14 years ago
|
||
Comment on attachment 373694 [details] [diff] [review] followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug (In reply to comment #16) > If you do want to s/None/0/, now is the time... Let's not mingle our fixes unduly, just in case. I don't want to untangle back-outs for unrelated issues.
Assignee | ||
Comment 21•14 years ago
|
||
(In reply to comment #18) > >@@ -184,7 +183,8 @@ > >+ def __init__(self, isOptional=False, patchDir=".", workdir="build", > >+ **kwargs): > >@@ -196,13 +196,12 @@ > >+ self.addFactoryArguments(isOptional=isOptional, patchDir=patchDir) > > Misses workdir? > OK, I just did some good testing of this. Because workdir is a ShellCommand attribute, it will end up in an addFactoryArguments call when we reach ShellCommand.__init__. Same thing goes for 'env' in my latest patch. Given that, I'm pretty certain my latest patch is fine as is.
Assignee | ||
Comment 22•14 years ago
|
||
Comment on attachment 373694 [details] [diff] [review] followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug changeset: 257:9301fd18edfd
Attachment #373694 -
Flags: checked‑in+
Assignee | ||
Comment 23•14 years ago
|
||
Comment on attachment 373694 [details] [diff] [review] followup to addFactoryArguments in MozillaCheck, fix MozillaMochitest bug I reconfig'ed production-master for this.
Assignee | ||
Comment 24•14 years ago
|
||
In bug 469518 catlee pointed out that we don't need to do kwarg digging like my previous patch does. Here's a patch to avoid doing that, and make MozillaMochitest consistent with MozillaReftest once again. Sorry for all the patch noise due to my mistaken assumptions.
Attachment #374127 -
Flags: review?(ccooper)
Comment 25•14 years ago
|
||
Comment on attachment 374127 [details] [diff] [review] fix MozillaMochitest kwarg digging Yay for simplification.
Attachment #374127 -
Flags: review?(ccooper) → review+
Assignee | ||
Comment 26•14 years ago
|
||
Comment on attachment 372665 [details] [diff] [review] talos patch - same as before w/out lists as defaults parameters changeset: 1121:44cb4fec2f2b
Attachment #372665 -
Flags: checked‑in+
Assignee | ||
Comment 27•14 years ago
|
||
Attachment #375039 -
Flags: review?(catlee)
Assignee | ||
Comment 28•14 years ago
|
||
Attachment #375040 -
Flags: review?(catlee)
Updated•14 years ago
|
Attachment #375040 -
Flags: review?(catlee) → review+
Assignee | ||
Updated•14 years ago
|
Attachment #375039 -
Attachment is obsolete: true
Attachment #375039 -
Flags: review?(catlee)
Assignee | ||
Comment 29•14 years ago
|
||
Comment on attachment 375040 [details] [diff] [review] for real. changeset: 1122:3a50347f0bbd
Attachment #375040 -
Flags: checked‑in+
Assignee | ||
Updated•14 years ago
|
Attachment #374127 -
Flags: checked‑in+
Assignee | ||
Comment 30•14 years ago
|
||
Comment on attachment 374127 [details] [diff] [review] fix MozillaMochitest kwarg digging changeset: 266:dfc46d9683ab
Assignee | ||
Comment 31•14 years ago
|
||
production-master master has been reconfig'ed for the MozillaMochitest patch. Looks like we're all done here.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Product: mozilla.org → Release Engineering
You need to log in
before you can comment on or make changes to this bug.
Description
•