Ticket #3481 (closed enhancement: fixed )

Opened 1 year ago

Last modified 7 months ago

Improve Trial's --temp-directory option

Reported by: thijs Assigned to: thijs
Type: enhancement Priority: high
Milestone: Component: trial
Keywords: Cc:
Branch: branches/trial-tmp-marker-3481 Author: jonathanj, thijs
Launchpad Bug:

Description

Trial should drop a marker file into _trial_temp and refuse to delete and re-create any directory that doesn't have the marker. Docs should updated as well, see #2589

Attachments

trial-marker.diff (2.2 kB) - added by jonathanj 9 months ago.
trial-marker-1.diff (4.4 kB) - added by jonathanj 8 months ago.

Change History

  2009-03-19 21:33:34+00:00 changed by moonfallen

Yes, let's do this please. Just had my source directory deleted. Didn't lose anything important, fortunately.

  2009-05-19 17:13:50+00:00 changed by jonathanj

  • attachment trial-marker.diff added

  2009-05-19 17:14:36+00:00 changed by jonathanj

  • keywords set to review
  • owner deleted

  2009-06-04 09:27:37+00:00 changed by glyph

  • keywords deleted
  • owner set to jonathanj

The patch is great! Could you make a few small adjustments?

  1. In your test case, the name "my_runner" violates the coding standard. It should be "myRunner".
  2. In _removeSafely's docstring (thanks for adding that!) you should probably use L{} rather than C{} to refer to NoTrialMarker.
  3. I realize that trial is a pile of bad examples as far as this particular request goes, but could you use twisted.python.filepath.FilePath rather than os.path for path inspection and manipulation? As a bonus (although this is not required) you could remove the dependence on the shutil module, since FilePath handles recursive removal itself.
  4. NoTrialMarker's docstring could be more expository. Especially, why is this exception raised? When does trial look for a marker?
  5. Also, you might want to follow the example of _WorkingDirectoryBusy and make the exception private, since the only method that raises it is also private. It's always easy to make private stuff public later, less easy to decide it was a bad idea and make it private.

  2009-06-04 10:26:39+00:00 changed by jonathanj

  • attachment trial-marker-1.diff added

  2009-06-04 10:29:49+00:00 changed by jonathanj

  • keywords set to review
  • owner changed from jonathanj to glyph
  1. I've changed _setUpTestdir and _removeSafely to use FilePath internally.

Everything else you said made sense, and I've addressed those changes too.

  2009-06-04 21:03:11+00:00 changed by thijs

  • branch set to branches/trial-tmp-marker-3481
  • branch_author set to thijs

(In [26970]) Branching to 'trial-tmp-marker-3481'

  2009-06-04 21:08:18+00:00 changed by thijs

(In [26972]) Update copyright, refs #3481

  2009-06-04 21:24:16+00:00 changed by thijs

  • keywords deleted
  • branch_author changed from thijs to jonathanj, thijs

Buildbot is happy, looks ready to merge for me.

If this hits the trunk before #2589 does, then that one should be closed, or marked as fixed with the merge of this ticket. #2589 was created to add a warning to trial's commandline options, but I don't think we need to add more docs than that.

  2009-06-30 09:14:02+00:00 changed by glyph

  • owner changed from glyph to thijs

Erm... did you review this, or not? If so, then it should be reassigned to jonathanj, not me. If not, and you're looking for more feedback from me (although I don't see the question) as the reviewer of a non-committer contribution, you should merge it on behalf of jonathanj :).

  2009-06-30 09:15:11+00:00 changed by glyph

Gah, that comment was badly garbled. What I meant was:

If you reviewed this, you should be merging it on behalf of jonathanj.

If you just looked at it and gave it a positive comment, but wanted feedback from me, then you should be leaving the review keyword as you reassign it to me.

  2009-07-07 23:21:09+00:00 changed by thijs

  • status changed from new to closed
  • resolution set to fixed

(In [27098]) Merge trial-tmp-marker-3481: Trial now drops a marker file into _trial_temp and refuses to delete and re-create any directory that doesn't have the marker.

Author: jonathanj, thijs Reviewer: glyph Fixes: #3481

Note: See TracTickets for help on using tickets.