Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a production usable file adapter following cookpads style
I took some ideas from our previous logger, and from cookpads logger https://github.com/riseshia/oneshot_coverage/blob/master/lib/oneshot_coverage/logger/file_logger.rb I resolved issues like multiprocess by running in coverband_demo and tested both regular and one-shot. I think we could further improve the perf of one-shot for this adapter, but this is a fully functional versions that we could perhaps have them try to use.
- Loading branch information
Showing
8 changed files
with
98 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# frozen_string_literal: true | ||
|
||
module Coverband | ||
module Adapters | ||
### | ||
# StdoutStore is for testing and development | ||
# | ||
# Usage: | ||
# config.store = Coverband::Adapters::StdoutStore.new | ||
### | ||
class StdoutStore < Base | ||
def initialize(_opts = {}) | ||
super() | ||
end | ||
|
||
def clear! | ||
# NOOP | ||
end | ||
|
||
def size | ||
0 | ||
end | ||
|
||
def migrate! | ||
raise NotImplementedError, "StdoutStore doesn't support migrations" | ||
end | ||
|
||
def coverage(_local_type = nil) | ||
{} | ||
end | ||
|
||
def save_report(report) | ||
$stdout.puts(report.to_json) | ||
end | ||
|
||
def raw_store | ||
raise NotImplementedError, "StdoutStore doesn't support raw_store" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters