Repository navigation
SAO-17698: Address review comments #271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: agent-simulation-poc
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,16 @@ def test_simulation_run_scope_restores_the_previous_value() -> None: | |
| _simulation_run_id_context.reset(outer_token) | ||
|
|
||
|
|
||
| def test_simulation_run_id_is_normalized_at_public_context_boundaries(monkeypatch: pytest.MonkeyPatch) -> None: | ||
| monkeypatch.setattr(splunk_ao_context, "get_logger_instance", Mock()) | ||
|
|
||
| with splunk_ao_context.simulation_run(" run-1\n"): | ||
| assert _simulation_run_id_context.get() == "run-1" | ||
|
|
||
| with splunk_ao_context(simulation_run_id="\trun-2 "): | ||
| assert _simulation_run_id_context.get() == "run-2" | ||
|
Comment on lines
+87
to
+94
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: This covers trimming at the public context entry points, but only checks the context variable. |
||
|
|
||
|
|
||
| def test_init_clears_active_simulation_run(monkeypatch: pytest.MonkeyPatch) -> None: | ||
| logger = Mock() | ||
| singleton = Mock() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing in this module uses this import any more. It only keeps the old
splunk_ao.converter.attribute_mappingimport path working. Ruff 0.15.22, the version pinned in pre-commit, flags it:Ruff marks it auto-fixable, and the ruff hook in
.pre-commit-config.yamlruns with--fix. The next commit that touches this file deletes the line silently. Five test modules still import the constant from here and would then fail at collection withImportError:tests/test_tracing.py:9tests/test_span_converter.py:16tests/test_otel_native_paths.py:17tests/test_logger_otel_egress.py:10tests/test_http_instrumentation.py:35Suggested fix: point those five imports at
splunk_ao.simulation_run_contextand delete this line. The old path only exists onagent-simulation-pocand was never released, so there are no outside callers to keep working. If you would rather keep the alias, make the re-export explicit so Ruff accepts it: