prestaconcept / PrestaSitemapBundle

A symfony bundle that provides tools to build a rich application sitemap. The main goals are : simple, no databases, various namespace (eg. google image), respect constraints etc.
MIT License
347 stars 100 forks source link

Always cleanup tmp dir on sitemap dump #260

Closed yann-eugone closed 3 years ago

yann-eugone commented 3 years ago

As suspected in #258 Dumper service may not call cleanup if an exception is thrown during dump.

This wrap (almost) the whole dump function with a try / finally so cleanup is always called.

After adding the assertTempFilesWereRemoved in DumperTest, some tests were already failing (testExistingInvalidSitemap). I still decided to add a dedicated test case to handle a throwing exception listener.