Skip to content

Commit e79967b

Browse files
authored
[CONFIGURATION] File configuration - functional tests (open-telemetry#3606)
1 parent 6d7b8ad commit e79967b

36 files changed

+1271
-7
lines changed

api/include/opentelemetry/common/string_util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#pragma once
55

6+
#include <ctype.h>
7+
68
#include "opentelemetry/nostd/string_view.h"
79
#include "opentelemetry/version.h"
810

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Copyright The OpenTelemetry Authors
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
set -e
7+
8+
# To run tests in a local dev environment:
9+
# - set BUILD_DIR to the top level build directory,
10+
11+
[ -z "${BUILD_DIR}" ] && export BUILD_DIR="${HOME}/build"
12+
13+
export EXAMPLE_BIN_DIR="${BUILD_DIR}/examples/configuration/"
14+
15+
# Make sure `example_yaml` is in the path
16+
export PATH=${PATH}:${EXAMPLE_BIN_DIR}
17+
18+
shelltest ./shelltests
19+
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+
$ example_yaml --test --yaml shelltests/disabled_empty.yaml
5+
>
6+
MODEL PARSED
7+
SDK CREATED
8+
>= 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 1.0.0
5+
disabled:
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+
$ example_yaml --test --yaml shelltests/disabled_false.yaml
5+
>
6+
MODEL PARSED
7+
SDK CREATED
8+
>= 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 1.0.0
5+
disabled: false
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+
$ example_yaml --test --yaml shelltests/disabled_true.yaml
5+
>
6+
MODEL PARSED
7+
SDK CREATED
8+
>= 0
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
file_format: 1.0.0
5+
disabled: true
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+
$ example_yaml --test --yaml shelltests/empty.yaml
5+
>
6+
[ERROR] [Yaml Configuration Parser] Parse failed with exception: Yaml: not a map, looking for: file_format
7+
FAILED TO PARSE MODEL
8+
>= 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright The OpenTelemetry Authors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# empty yaml file

0 commit comments

Comments
 (0)