Skip to content

Commit

Permalink
refactor: log server config
Browse files Browse the repository at this point in the history
Signed-off-by: Han Xiao <[email protected]>
  • Loading branch information
hanxiao committed Apr 9, 2020
1 parent 301b41a commit dd43f00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ def test_flow_no_container(self):
fl.index(raw_bytes=random_docs(10), in_proto=True)

def test_flow_yaml_dump(self):
f = Flow(port_sse=12345,
f = Flow(logserver_config='yaml/test-server-config.yml',
optimize_level=FlowOptimizeLevel.IGNORE_GATEWAY,
no_gateway=True)
f.save_config('test1.yml')

fl = Flow.load_config('test1.yml')
self.assertEqual(f.args.port_sse, fl.args.port_sse)
self.assertEqual(f.args.logserver_config, fl.args.logserver_config)
self.assertEqual(f.args.no_gateway, fl.args.no_gateway)
self.assertEqual(f.args.optimize_level, fl.args.optimize_level)
self.add_tmpfile('test1.yml')
Expand Down
10 changes: 10 additions & 0 deletions tests/yaml/test-server-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
host: 0.0.0.0
port: 5000
endpoints:
log: /log/stream # fetching log in SSE stream
profile: /stream/profile # fetching profiling log in SSE stream
yaml: /yaml # get the YAML spec of a flow
shutdown: /action/shutdown # shutdown the log server
ready: /action/isready # tell if the log server is ready, return 200 if yes


0 comments on commit dd43f00

Please sign in to comment.