Test-More / TB2

Test::Builder version 2, the next generation of building testing modules in Perl
Other
1 stars 0 forks source link

Remove storage of events and results from History #179

Closed schwernbot closed 10 years ago

schwernbot commented 10 years ago

From: @schwern Date: Monday Nov 14, 2011 at 02:45 GMT Orig: https://github.com/Test-More/test-more/issues/198

Ideally, TB2 should consume O(1) memory no matter how many results are run. This cannot be true if History stores events and results. To satisfy this, History keeps statistics and there is the TB2::NoHistory subclass which does not store events.

Unfortunately, when something is passed a "History" object, it might be NoHistory and thus some methods might not be safe to use. This is awkward. The relationship should be inverted. TB2::History should only keep statistics. A subclass or role or even separate watcher should store roles and events.

Change Test::Builder2::History to only store event statistics. Add whatever methods are necessary to make History useful to all its current users.

Write a role which stores events and results. Make sure there's a hook in History->accept_event to store the event if $self does the role.

schwernbot commented 10 years ago

From: @schwern Date: Monday Jun 18, 2012 at 22:04 GMT Orig: https://github.com/Test-More/test-more/issues/198#issuecomment-6410637

Complete. I decided to use a storage object rather than a role. Per-object roles might not make it after Mouse gets torn out and they might have performance issues.