Skip to content

Commit

Permalink
Fix OTLP exporter config tests (open-telemetry#1395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariojonke authored Nov 23, 2020
1 parent 8660dea commit 03b2480
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
from collections import OrderedDict
from unittest import TestCase
from unittest.mock import patch
Expand Down Expand Up @@ -44,6 +45,8 @@
from opentelemetry.sdk.metrics.export.aggregate import SumAggregator
from opentelemetry.sdk.resources import Resource as SDKResource

THIS_DIR = os.path.dirname(__file__)


class TestOTLPMetricExporter(TestCase):
@patch("opentelemetry.sdk.metrics.export.aggregate.time_ns")
Expand Down Expand Up @@ -75,7 +78,8 @@ def tearDown(self):
"os.environ",
{
"OTEL_EXPORTER_OTLP_METRIC_ENDPOINT": "collector:55680",
"OTEL_EXPORTER_OTLP_METRIC_CERTIFICATE": "fixtures/test.cert",
"OTEL_EXPORTER_OTLP_METRIC_CERTIFICATE": THIS_DIR
+ "/fixtures/test.cert",
"OTEL_EXPORTER_OTLP_METRIC_HEADERS": "key1:value1;key2:value2",
"OTEL_EXPORTER_OTLP_METRIC_TIMEOUT": "10",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
from collections import OrderedDict
from concurrent.futures import ThreadPoolExecutor
from unittest import TestCase
Expand Down Expand Up @@ -53,6 +54,8 @@
)
from opentelemetry.sdk.util.instrumentation import InstrumentationInfo

THIS_DIR = os.path.dirname(__file__)


class TraceServiceServicerUNAVAILABLEDelay(TraceServiceServicer):
# pylint: disable=invalid-name,unused-argument,no-self-use
Expand Down Expand Up @@ -165,7 +168,8 @@ def tearDown(self):
"os.environ",
{
"OTEL_EXPORTER_OTLP_SPAN_ENDPOINT": "collector:55680",
"OTEL_EXPORTER_OTLP_SPAN_CERTIFICATE": "fixtures/test.cert",
"OTEL_EXPORTER_OTLP_SPAN_CERTIFICATE": THIS_DIR
+ "/fixtures/test.cert",
"OTEL_EXPORTER_OTLP_SPAN_HEADERS": "key1:value1;key2:value2",
"OTEL_EXPORTER_OTLP_SPAN_TIMEOUT": "10",
},
Expand Down

0 comments on commit 03b2480

Please sign in to comment.