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
Test-isolation-problem in test_migration_extendedtypes_vocabulary_result #251
Comments
I skipped the test for now and Oh what joy! No more test-isolation-problems when p.a.linkintegrity is part of the p.a.testing group \o/ (http://jenkins.plone.org/view/PLIPs/job/plip-698-linkintegrity/30/) |
@pbauer This test isolation issue is most likely not caused by that single test but it is rather a sign that the test fixture or that package itself is causing trouble. Therefore skipping the test is not the best solution, since we just choose to ignore that problem until the next person runs into it. That person then needs to discover the problems that are hidden because people skipped or removed tests before. There is no easy way to fix test isolation problems and skipping tests does not solve any test isolation issue, it just makes things worse. What I usually do to try those kind of things is I try to find two packages that have an isolation issue and run them together with: bin/test -s plone.app.contenttypes -s plone.app.linkintegrity When I can't see an obvious problem with the fixtures (like using functional instead of integration fixture, etc.), I start to play around with the test code to see if I can find the cause for the problem. |
@pbauer @tisto I assume unregistering the adapter in the test would be a good solution, something like... provideAdapter(DummySchemaExtender, name=u"dummy.extender")
# Clear cache
if CACHE_ENABLED:
delattr(self.request, CACHE_KEY)
try:
self.assertIn('dummy', doc.Schema()._names)
vocabulary = factory(self.portal)
self.assertEqual(1, len(vocabulary), 'Expect one entry')
self.assertEqual("Document (1) - extended fields: 'dummy'",
finally:
sm = getGlobalSiteManager()
sm.unregisterAdapter(...) Basically all tests after this one have a component registry with a From time to time, we (at 4teamwok) also stumbled over isolation problems regarding the component registry. Our solution was (still is) using a |
@tisto exactly what I did. The traceback happens when running |
@maethu Thanks, a pull-request would be most welcome! |
@maethu ping? |
For fun and profit I added plone.app.linkintegrity to the "normal" test-group (plone.app.testing) in plone/buildout.coredev@940252e
The plip-build uncovered a test-isolation issue (see traceback below) originating in
plone.app.contenttypes.tests.test_migration.MigrateFromATContentTypesTest.test_migration_extendedtypes_vocabulary_result
. The testtest_migration_extendedtypes_vocabulary_result
looks pretty scary (but proves that a real thing works).When running the tests of plone.app.linkintegrity that use the same layer (PLONE_APP_CONTENTTYPES_MIGRATION_FIXTURE) I get:
Should we:
a) skip the test (the working code is very unlikely to change)
b) fix the test (how?)
c) add your favorite option here
The text was updated successfully, but these errors were encountered: