Skip to content
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

chore: use synchronous batch span #36

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pytest_mergify/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __post_init__(self) -> None:

if os.environ.get("PYTEST_MERGIFY_DEBUG"):
self.exporter = export.ConsoleSpanExporter()
span_processor = export.SimpleSpanProcessor(self.exporter)
span_processor = SynchronousBatchSpanProcessor(self.exporter)
elif utils.strtobool(os.environ.get("_PYTEST_MERGIFY_TEST", "false")):
from opentelemetry.sdk.trace.export.in_memory_span_exporter import (
InMemorySpanExporter,
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def pytester_with_spans(
def _run(
code: str = _DEFAULT_PYTESTER_CODE,
) -> PytesterWithSpanReturnT:
monkeypatch.delenv("PYTEST_MERGIFY_DEBUG", raising=False)
monkeypatch.setenv("_PYTEST_MERGIFY_TEST", "true")
plugin = pytest_mergify.PytestMergify()
pytester.makepyfile(code)
Expand Down
1 change: 1 addition & 0 deletions tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_errors_logs(
monkeypatch: pytest.MonkeyPatch,
) -> None:
# This will try to upload traces, but we don't have a real exporter so it will log errors.
monkeypatch.delenv("PYTEST_MERGIFY_DEBUG", raising=False)
monkeypatch.setenv("MERGIFY_TOKEN", "x")
monkeypatch.setenv("CI", "1")
monkeypatch.setenv("GITHUB_ACTIONS", "true")
Expand Down