Page MenuHomePhabricator

Canonical phutil way to retreive file from Unit Test
OpenPublic

Asked by tycho.tatitscheff on Nov 28 2015, 11:30 AM.

Details

NOTE: I'm asking this to help me writing some external unit engine. I'm facing a problem retrieving the xml content and seeking for a canonical way of doing this kind of stuff.

Sometimes test runners allow to specify the junit xml (for instance pytest).
It makes really simple to retrieve info from unit engine. We "just"

  • create a new Tempfile
  • pass this file to feature

But some unit engines doesn't allow to specify the file.
Rather they (most of the time) allow to specify a directory for xml output.
Is theire a connonical way to retrieve the xml output in this case:

  • In fact, I didn't find a TempDir in liphutil/src/filesystem/. Something like TempFile will be cool to ensure that phab delete the dir after the object is deleted.
  • It would be cool if TempDir wrapper as a mecanism to get the file in the dir matching a filter

Before reinventing the wheel :

  • does a similar mecanism exists
  • if not, is upstream interessed by such a wrapper ?