Re: how to get tests passing for Plone 5

Timo Stollenwerk <tisto-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.devel
Message-ID <[email protected]>
Hi,

I just fixed the Plone 5 tests for plone.app.intid and I was wondering
about the pattern that I applied:

One plone.app.intid test just needs a basic content object to work with.
I was thinking that it would be way too heavy to fetch (and setup) the
PLONE_APP_CONTENTTYPES_FIXTURE as a test dependency for that. Therefore
I just created a type with DexterityFTI that the test could use:

fti = DexterityFTI('Folder')
self.portal.portal_types._setObject('Folder', fti)

https://github.com/plone/plone.app.intid/commit/40c216a3b83ff6644ded313b48c585705f01ac40

Does this approach make sense to you? Should we try to even remove the
plone.dexterity test dependency with something even lighter? Would it
make sense to provide a test fixture in plone.app.testing that maybe
just provides a Folder and a Document?

Cheers,
Timo

Am 22.08.2013 21:09, schrieb David Glick (Plone):
> Okay, here's the deal with Plone 5: there is a branch started (5.0 
> branch of buildout.coredev) which uses plone.app.contenttypes as the 
> default content type system. But there are a lot of tests which are 
> breaking because they assume that the default content types are 
> Archetypes-based. 
> (http://jenkins.plone.org/job/plone-5.0-python-2.7/lastCompletedBuild/testReport/) 
> I could really use some help getting these fixed.
> 
> A large part of this is making sure that tests are using layers based on 
> the correct fixture. At present the fixtures that we can choose from are:
> 1. PLONE_FIXTURE from plone.app.testing. As of Plone 5 this no longer 
> installs a content type system, so it's only appropriate for tests that 
> don't use content types.
> 2. PLONE_APP_CONTENTTYPES_FIXTURE from plone.app.contenttypes. This 
> extends PLONE_FIXTURE and adds the plone.app.contenttypes profile, 
> adding Dexterity-based core content types. Tests of Dexterity-based 
> content should use this.
> 3. A yet-to-be-created fixture in Products.ATContentTypes that installs 
> Archetypes-based content types like in Plone 4. Tests of 
> Archetypes-based content should use this.
> 4. PloneTestCase. We should really work on converting these tests to use 
> plone.testing-based layers, but in the meantime, the setup for Plone 5 
> has been adjusted to install types from plone.app.contenttypes rather 
> than ATContentTypes. This change is the biggest source of the tests that 
> are currently failing. We can move these tests to a class that uses the 
> Products.ATContentTypes fixture from #3. But we also need to consider:
>    a. Does it test something that should also continue to work with 
> Dexterity content? If so we should keep a second copy of the test in a 
> class using the plone.app.contenttypes fixture.
>    b. Does the failure indicate a problem in Dexterity's compatibility 
> with Archetypes content? If so, rather than changing the test maybe we 
> need to fix something in Dexterity.
> 
> This effort is a work in progress; suggestions of improvements to these 
> guidelines are welcome. If in doubt about what to do for a particular 
> test, talk to me here or on IRC.
> 
> Oh, also, jenkins is showing significantly fewer tests running in the 
> Plone 5 job compared to the Plone 4 jobs. That probably means there are 
> some import errors preventing tests from being discovered, so it would 
> be great if someone could look into that.
> 
> thanks,
> David
> 
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and 
> AppDynamics. Performance Central is your source for news, insights, 
> analysis and resources for efficient Application Performance Management. 
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Plone-developers mailing list
> Plone-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/plone-developers
> 


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.