Skip to content

Commit c118e30

Browse files
authored
tps: disable debugserver by default (#619)
1 parent 7bb61b8 commit c118e30

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

jobs/tps/spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ properties:
7373
description: "PEM-encoded client key"
7474

7575
capi.tps.watcher.debug_addr:
76-
description: "address at which to serve debug info"
77-
default: "127.0.0.1:17015"
76+
description: "Address at which to serve debug info, e.g. 127.0.0.1:17015. Debug server is disabled if empty (default)."
77+
default: ""
7878
capi.tps.watcher.locket.api_location:
7979
description: "Hostname and port of the Locket server"
8080
default: ""

spec/tps/tps_watcher_config_spec.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,36 @@ module Test
1717
let(:links) { [] }
1818
let(:template) { job.template('config/tps_watcher_config.json') }
1919

20+
describe 'debug server' do
21+
it 'disables the debug server by default' do
22+
rendered_template = template.render({}, consumes: links)
23+
parsed_template = JSON.parse(rendered_template)
24+
25+
expect(parsed_template['debug_server_config']['debug_address']).to eq('')
26+
end
27+
28+
context 'when capi.tps.watcher.debug_addr is configured' do
29+
let(:manifest_overrides) do
30+
{
31+
'capi' => {
32+
'tps' => {
33+
'watcher' => {
34+
'debug_addr' => '127.0.0.1:17015'
35+
}
36+
}
37+
}
38+
}
39+
end
40+
41+
it 'sets the debug address' do
42+
rendered_template = template.render(manifest_overrides, consumes: links)
43+
parsed_template = JSON.parse(rendered_template)
44+
45+
expect(parsed_template['debug_server_config']['debug_address']).to eq('127.0.0.1:17015')
46+
end
47+
end
48+
end
49+
2050
describe 'log time format' do
2151
it 'defaults the log timestamp format to rfc3339' do
2252
rendered_template = template.render({}, consumes: links)

0 commit comments

Comments
 (0)