File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ class ConfigLoader
24
24
normalize_headers : true
25
25
} . freeze
26
26
27
+ SILENCE_CONFIG_LOADER_MESSAGES = ENV . fetch (
28
+ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" , "false"
29
+ ) . downcase == "true" . freeze
30
+
27
31
# Load and merge configuration from various sources
28
32
#
29
33
# @param config_path [String, Hash] Path to config file or config hash
@@ -65,7 +69,7 @@ def self.load(config_path: nil)
65
69
66
70
# Log overrides if any were made
67
71
if overrides . any?
68
- puts "INFO: Configuration overrides applied from: #{ overrides . join ( ', ' ) } "
72
+ puts "INFO: Configuration overrides applied from: #{ overrides . join ( ', ' ) } " unless SILENCE_CONFIG_LOADER_MESSAGES
69
73
end
70
74
71
75
return config
@@ -112,7 +116,7 @@ def self.load_config_file(file_path)
112
116
result
113
117
rescue => e
114
118
# Log this error with meaningful information
115
- puts "ERROR: Failed to load config file '#{ file_path } ': #{ e . message } "
119
+ puts "ERROR: Failed to load config file '#{ file_path } ': #{ e . message } " unless SILENCE_CONFIG_LOADER_MESSAGES
116
120
nil
117
121
end
118
122
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true" # Silence config loader messages in tests
4
+
3
5
require_relative "../../lib/hooks"
4
6
require "rack/test"
5
7
require "json"
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
2
3
+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true" # Silence config loader messages in tests
4
+
3
5
require_relative "../../lib/hooks"
4
6
require "rack/test"
5
7
require "json"
Original file line number Diff line number Diff line change 12
12
13
13
ENV [ "GITHUB_WEBHOOK_SECRET" ] = FAKE_HMAC_SECRET
14
14
ENV [ "ALT_WEBHOOK_SECRET" ] = FAKE_ALT_HMAC_SECRET
15
+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true"
15
16
16
17
COV_DIR = File . expand_path ( "../../coverage" , File . dirname ( __FILE__ ) )
17
18
You can’t perform that action at this time.
0 commit comments