Task #41224

Temporary files should be deleted after test is done

Added by Nicole Cordes about 8 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Tests
Target version:
Start date:
2012-09-21
Due date:
% Done:

0%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

In some tests (e.g. TYPO3\CMS\Core\Tests\Unit\Resource\Driver\LocalDriverTest) temp files are created. Those aren't deleted after test was done and mass up temp folder. Maybe we could add some routine to tearDown function to collect temporary files and delete them.

History

#1 Updated by Oliver Hader about 8 years ago

  • Category set to Tests
  • Status changed from New to Accepted
  • Complexity set to medium

#2 Updated by Mathias Schreiber almost 6 years ago

  • Status changed from Accepted to Needs Feedback
  • Assignee set to Nicole Cordes

mind pushing a patch for this one? :)

#3 Updated by Anja Leichsenring over 5 years ago

  • Sprint Focus set to On Location Sprint

#4 Updated by Steffen Müller over 5 years ago

Afaik these temp files are a workaround for known issues in vfsStream.

We should evaluate if replacing temp files with vfsStream is a solution nowadays with PHP >=5.4

touch(), chown(), chgrp() and chmod() only work with PHP >= 5.4 because support of stream wrappers for those functions was first added with PHP 5.4, see issue #56. With PHP 5.3 an error with the message "Unable to create file vfs://... because No such file or directory" will be raised

https://github.com/mikey179/vfsStream/wiki/Known-Issues

#5 Updated by Christian Kuhn over 5 years ago

  • Status changed from Needs Feedback to Closed

We had a clean up round in this area and at the moment all files created by unit tests are deleted afterwards so there are no leftovers (functionals are encapsulated within sub directories of typo3temp and those will stay).

Issue is rejected for now. Please create a fresh issue if you still find unit tests creating files and not removing them (easy to solve then with putting the stuff to $this->testFilesToDelete[] or similar, see UnitTestBase class.

#6 Updated by Anja Leichsenring almost 5 years ago

  • Sprint Focus deleted (On Location Sprint)

Also available in: Atom PDF