Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
keithralphs committed Oct 31, 2024
1 parent 5f2a540 commit 9f52398
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 34 deletions.
36 changes: 15 additions & 21 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"request": "launch",
"justMyCode": false,
"module": "blueapi",
"args": [
"serve"
]
"args": "serve",
"env": {
"OTLP_EXPORT_ENABLED": "false"
},
},
{
"name": "Blueapi Server (Custom Config)",
Expand All @@ -40,38 +41,30 @@
"OTLP_EXPORT_ENABLED": "false"
},
},
{
"name": "Blueapi Server (Custom Config)",
"type": "debugpy",
"request": "launch",
"justMyCode": false,
"module": "blueapi",
"args": "--config ${input:config_path} serve"
},
{
"name": "Blueapi Controller",
"type": "debugpy",
"request": "launch",
"justMyCode": false,
"module": "blueapi",
"args": "controller ${input:controller_args}"
"args": "controller ${input:controller_args}",
"env": {
"OTLP_EXPORT_ENABLED": "false"
},
},
{
"name": "Blueapi Controller (Custom Config)",
"type": "debugpy",
"request": "launch",
"justMyCode": false,
"module": "blueapi",
"args": "-c ${input:config_path} controller ${input:args}"
"args": "-c ${input:config_path} controller ${input:controller_args}",
"env": {
"OTLP_EXPORT_ENABLED": "false"
},
},
],
"inputs": [
{
"id": "config_path",
"type": "promptString",
"description": "Path to configuration YAML file",
"default": ""
},
{
"id": "controller_args",
"type": "promptString",
Expand All @@ -81,7 +74,8 @@
{
"id": "config_path",
"type": "promptString",
"description": "Server config file path",
}
"description": "Path to configuration YAML file",
"default": ""
},
]
}
13 changes: 0 additions & 13 deletions tests/unit_tests/utils/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ def __init__(
self.service_name = service_name
self.top_span = Future()

# def prime(self):
# if self.top_span is not None:
# try:
# self.top_span.result(timeout=0.0)
# except:
# pass

def export(self, spans: Sequence[ReadableSpan]) -> SpanExportResult:
if self.top_span is not None and not self.top_span.done():
self.top_span.set_result(spans[-1])
Expand All @@ -40,12 +33,6 @@ def force_flush(self, timeout_millis: int = 30000) -> bool:
return True


# setup_tracing("test", False)
# PROVIDER = cast(TracerProvider, get_tracer_provider())
# EXPORTER = JsonObjectSpanExporter()
# PROVIDER.add_span_processor(BatchSpanProcessor(EXPORTER))


@contextmanager
def span_exporter(exporter: JsonObjectSpanExporter, func_name: str, *span_args: str):
"""Use as a with block around the function under test decorated with
Expand Down

0 comments on commit 9f52398

Please sign in to comment.