plone / plone.act

DEPRECATED Acts, not words : ACceptance Testing for Plone
2 stars 2 forks source link

Make all variables overridable by environment variables #27

Closed jone closed 11 years ago

jone commented 11 years ago

Allows e.g. changing the browser or the remote url (selenium grid) from the buildout.

This is important when using plone.act in a custom package as dependency for setting ACT up and using the predefined keywords.

datakurre commented 11 years ago

Just to make sure that this is what we really want...

I know, that pybot has support for overriding variables with command line parameters, but it is not possible to make zope.testrunner to accept extra parameters.

Therefore, I did add a feature for robotsuite that it takes all ROBOT_-prefixed environment variables (e.g. ROBOT_BROWSER, ROBOT_PLONE_SITEID, etc...) and passes them to pybot without the prefix. Therefore, ALL variables should already be overridable with by setting respective environment variables with ROBOT-prefix.

So, it should be already possible to override all variables. (And only non-ROBOT_-variable really required would be ZSERVER_PORT for plone.app.testing. I may not have documented this well yet. So, that's my fault.)

On the other hand. It makes sense to support these most important variables without ROBOT_-prefix. So, eventually

+1

jone commented 11 years ago

Ah, well. Didn't know that.

I had this idea for running it in jenkins:

Using the Port Allocator Plugin it is possible to define environment variable names which will be set dynamically to port numbers for each build. By not setting any variables in buildout the ones from jenkins will be used. This allows to have multiple concurrent builds, even of the same package (e.g. with branches or against different plone versions).

datakurre commented 11 years ago

Yes. My fault for not documenting that. Neverthless, for the most important variables, I think, direct environment aliases are good. (Actually, I didn't know before that it was possible to define robot variables in python modules like we do know.)

Thanks for the Jenkins tip. I was using Lock and Latches -plugin before, but Port Allocator is definitely better.