New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renderable locks master #1670
Renderable locks master #1670
Conversation
I was going to request tests, but I dont see any unit tests in "test_process_buildstep" dealing with locks right now, so this may not be easy. I'll leave it up to you. |
I did look for tests to use as a template and didn't find any. If you have any suggestions on how to do that I'd be interested |
svn test "test_mode_incremental_repourl_renderable" is a test for renderable things. I dunno... up to you if you want to try to make it all work. You could have it render a Mock type and just verify that some method gets called. Anyway, usually we have a strict "add unit tests" requirement for contributions, but this is a gray one and maybe not easy ... Our code would certainly be better off for it if you want to :) Would make it easier to do more tests in the future. Up to you. |
@vlovich this feature did not appear out of nowhere, did it? :) I'd suggest looking at the way it's used and base the test on that. |
@sa2ajj I think it's just there's not a lot of testing around it and he'd have to write some of that basis himself .. which is a good thing in the end, but it is a little involved. |
I agree it might require a bit of effort, I'd like to hear the estimate based on some practical approach though. @vlovich please spend a bit of time to see how much effort it's gonna take. |
One problem I've had is that running the tests locally there are failures. How do I know if they work or not? PYTHONPATH=. trial buildbot.test
|
I've seen failures in "integration" as well. Some tips:
|
I do still see the same errors on master. It still doesn't leave me with a lot of confidence with making changes if tests are randomly failing only locally. Automation does not appear to have this problem... |
@sa2ajj I agree there needs to be unit tests. I don't think my original suggestion would even work. It looks like the attributes are rendered after locks are acquired which is too late. I've tried writing a test but I feel like I'm really off on a tangent at this point & there must be an easier way. Here's what I have so far:
It fails with:
|
1b6ce89
to
3deae56
Compare
OK. Took my best shot at writing a unit test. A couple of fakes were insufficient but hopefully I did it right. Turns out the implementation was wrong as the locks are acquired before we render the properties. |
@@ -438,6 +438,8 @@ def startStep(self, remote): | |||
name=util.ascii2unicode(self.name)) | |||
yield self.master.data.updates.startStep(self.stepid) | |||
|
|||
self.locks = yield self.build.render(self.locks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a test where the locks are not renderable? I'm not sure this line will work in that case.
test looks good. Need another one to make me confident. |
I think it looks good. I agree w/ @tardyp about a non-renderable locks + I'd appreciate a phrase (or two) in the release notes. |
(I'll move this todo to somebody who does it :)) |
Setup the slavebuilder & locks as well.
Setup the botmaster attribute.
3deae56
to
4a910f6
Compare
The expected usage is that someone would create a renderable that returns a list of locks so that this list can be dynamic.
4a910f6
to
9393a94
Compare
Seems like tests pass even with non-renderable lock. Was there some reason to think that |
👍 |
Hi looks like some users see that this change break their conf. |
The logs indicate buildbot-0.8.13 but only 0.8.12 has been released. Did someone try to backport this to 0.8.12? There's a separate pull request for that but it's blocked on some kind of test failure I can't figure out. |
As requested, this change cherry-picked onto master.