Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Create a NoHistory object rather than $history->should_keep_history #46

Closed
schwern opened this Issue Aug 28, 2010 · 2 comments

Comments

Projects
None yet
2 participants
Owner

schwern commented Aug 28, 2010

Rather than have a flag saying whether to keep history or not, have a subclass of History that does not store individual results.

It can keep summary information as long as that summary consumes O(1) memory. is_passing(), for example, and perhaps a summary of the number of tests which passed, failed, seen, etc...

It will throw an exception if you ask for information it does not have, like results() and summary().

For bonus points, allow a NoHistory object to be generated from a History object. That would summarize and store the current historical state for continuity.

notbenh commented Sep 14, 2010

NoHistory Object

http://github.com/notbenh/test-more/blob/f5bd716b1763229d95d7b2b9d35679a768b70e90/lib/Test/Builder2/NoHistoryStack.pm

HistoryStack now has a consume method that will take a list of history objects (currently only HistoryStack's) and replay the history in the consuming object.

http://github.com/notbenh/test-more/commit/f5bd716b1763229d95d7b2b9d35679a768b70e90

So to 'strip' history would look something like:

my $no_history = Test::Builder2::NoHistoryStack->create->consume($history);

Owner

schwern commented Oct 7, 2010

Solved by Test::Builder2::NoHistory.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment