Skip to content

Commit b2185ee

Browse files
committed
More functional tests
1 parent 69aa84b commit b2185ee

16 files changed

+190
-55
lines changed

functional/configuration/main.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include <stdio.h>
5+
#include <stdlib.h>
56
#include <string.h>
6-
#include <memory>
77
#include <string>
88

9+
// #include <memory>
10+
911
#include "opentelemetry/exporters/ostream/console_log_record_builder.h"
1012
#include "opentelemetry/exporters/ostream/console_push_metric_builder.h"
1113
#include "opentelemetry/exporters/ostream/console_span_builder.h"
14+
#include "opentelemetry/nostd/shared_ptr.h"
15+
#include "opentelemetry/sdk/common/attribute_utils.h"
1216
#include "opentelemetry/sdk/common/global_log_handler.h"
1317
#include "opentelemetry/sdk/configuration/configuration.h"
1418
#include "opentelemetry/sdk/configuration/configured_sdk.h"
@@ -180,7 +184,7 @@ void InitOtel(const std::string &config_file)
180184

181185
sdk = opentelemetry::sdk::configuration::ConfiguredSdk::Create(registry, model);
182186

183-
if (model != nullptr)
187+
if (sdk != nullptr)
184188
{
185189
fprintf(stdout, "SDK CREATED\n");
186190
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
$ otel_configuration_check --yaml shelltests/propagator_broken.yaml
5+
>
6+
[ERROR] [Yaml Configuration Parser] Parse failed with exception: Illegal composite child 2, properties count: 3
7+
FAILED TO PARSE MODEL
8+
>= 1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 0.0
5+
6+
propagator:
7+
composite:
8+
# This is ok (child 1)
9+
- tracecontext:
10+
# This is broken (child 2)
11+
- tracecontext:
12+
foo:
13+
bar:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
$ otel_configuration_check --yaml shelltests/propagator_multi.yaml
5+
>
6+
MODEL PARSED
7+
SDK CREATED
8+
>= 0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 0.0
5+
6+
propagator:
7+
composite:
8+
- tracecontext:
9+
- baggage:
10+
- b3:
11+
- b3multi:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
$ otel_configuration_check --yaml shelltests/propagator_ottrace.yaml
5+
>
6+
MODEL PARSED
7+
[ERROR] [Configured Sdk] builder failed with exception: CreateTextMapPropagator() no builder for ottrace
8+
FAILED TO CREATE SDK
9+
>= 2
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 0.0
5+
6+
propagator:
7+
composite:
8+
- ottrace:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
$ otel_configuration_check --yaml shelltests/propagator_single.yaml
5+
>
6+
MODEL PARSED
7+
SDK CREATED
8+
>= 0
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 0.0
5+
6+
propagator:
7+
composite:
8+
- tracecontext:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
$ otel_configuration_check --yaml shelltests/propagator_unknown.yaml
5+
>
6+
MODEL PARSED
7+
[ERROR] [Configured Sdk] builder failed with exception: CreateTextMapPropagator() no builder for never_hear_of_this_one
8+
FAILED TO CREATE SDK
9+
>= 2

0 commit comments

Comments
 (0)