Skip to content

Commit

Permalink
Merge pull request #506 from jjb/patch-2
Browse files Browse the repository at this point in the history
ability to hide settings view
  • Loading branch information
danmayer authored Apr 2, 2024
2 parents 1bfcf42 + 0819b07 commit 42eae0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ This feature is enabled by default. To stop this feature, disable the feature in

![image](https://raw.github.com/danmayer/coverband/master/docs/coverband_view_tracker.png)

### Hiding settings

Coverband provides a view of all of its current settings. Sometimes you might want to hide this view,
such as when sharing coverband data with a large number of developers of varying trust levels.
You can disable the settings view like so:

`config.hide_settings = false`

### Fixing Coverage Only Shows Loading Hits

If all your coverage is being counted as loading or eager_loading coverage, and nothing is showing as runtime Coverage the initialization hook failed for some reason. The most likely reason for this issue is manually calling `eager_load!` on some Plugin/Gem. If you or a plugin is altering the Rails initialization process, you can manually flip Coverband to runtime coverage by calling these two lines, in an `after_initialize` block, in `application.rb`.
Expand Down
3 changes: 2 additions & 1 deletion lib/coverband/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Configuration
:view_tracker, :defer_eager_loading_data,
:track_routes, :route_tracker,
:track_translations, :translations_tracker,
:trackers, :csp_policy
:trackers, :csp_policy, :hide_settings

attr_writer :logger, :s3_region, :s3_bucket, :s3_access_key_id,
:s3_secret_access_key, :password, :api_key, :service_url, :coverband_timeout, :service_dev_mode,
Expand Down Expand Up @@ -86,6 +86,7 @@ def reset
@all_root_patterns = nil
@password = nil
@csp_policy = false
@hide_settings = false

# coverband service settings
@api_key = nil
Expand Down
1 change: 1 addition & 0 deletions lib/coverband/reporters/web.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def json
end

def settings
return "" if Coverband.configuration.hide_settings
Coverband::Utils::HTMLFormatter.new(nil, base_path: base_path).format_settings!
end

Expand Down

0 comments on commit 42eae0d

Please sign in to comment.