On Thu, Nov 11, 2010 at 6:31 PM, Chris McDonough <chr...@plope.com> wrote:
> On Thu, 2010-11-11 at 00:46 -0800, Mike Orr wrote:
>> On Wed, Nov 10, 2010 at 11:11 PM, Alexandre Conrad
>> <alexandre.con...@gmail.com> wrote:
>> > Hey Mike,
>> >
>> > I agree with you that having questions would be nice. And for people
>> > not liking the questions, maybe we could have them answered
>> > automatically by passing options such as --with-sqla --with-zodb
>> > --with-mako --with-urldispatch, ... Just an idea.
>>
>> The question prompts are provided by "paster create". Supposedly you
>> can pass variables at the end of the command line to pre-answer them
>> but it hasn't worked for me.
>>
>> How do conditionals hinder application maintenance? Or should we just
>> say that since it hasn't been a problem for Pylons maintainers, that
>> level of complexity is OK. But if it gets much more complex it could
>> be too much. E.g., ZODB should only need a couple of if's, but auth
>> could require several if's and be too complex for the same template.
>
> My current strategy for making paster template changes is this:
>
> - I change the template.
>
> - I use "paster create -t" to create an instance from the template.
>
> - I run its tests.
>
> - I make sure it runs, and I visit it in a browser.
>
> This is definiltey a little silly and painful, there really should be
> some automated tests for each template.  But there isn't, because
> writing automated tests for paster templates is harder than testing
> "normal" code, so I haven't written any.
>
> When we move to conditionalized templates, those steps become:
>
> - I change the template.
>
> - For each combination of features X*Y*Z:
>
>  - I use "paster create -t" to create an instance from the template
>    for the combination.
>
>  - I run its tests.
>
>  - I make sure it runs, and visit it in a browser.
>
> So moving to conditionalized templates seems to imply:
>
> - The risk that you will break one set of features by changing another
>  begins to exist.  This isn't a problem for single-purpose templates
>  because they map to a single set of features.
>
> - Automated testing will become required, because the combinatorial
>  effect of putting all the features into the same template makes it
>  infeasible to test by hand.
>
> As long as we have some automated tests that tests each combination of
> features in the master template (somehow), my distaste for conditionals
> goes away.

paste provide some fixtures for that. You can find some examples in Pylons:

http://bitbucket.org/bbangert/pylons/src/tip/tests/test_webapps/test_make_project.py

And Shabti: 
http://bitbucket.org/gjhiggins/shabti/src/tip/tests/test_make_project.py

Hope this will help to choose the conditional option. I'm also +1 for this.

--
Gael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-de...@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to