Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Comments

@schwern
Copy link
Contributor

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
Copy link

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);

@schwern
Copy link
Contributor Author

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
Projects
None yet
Development

No branches or pull requests

2 participants