Skip to content

Commit a026bee

Browse files
cosmo0920edsiper
authored andcommitted
config_format: yaml: test: Make runnable for yaml config on Windows
Signed-off-by: Hiroshi Hatake <[email protected]>
1 parent bc796b2 commit a026bee

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

tests/internal/config_format_yaml.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@
1111

1212
#include "flb_tests_internal.h"
1313

14+
#ifdef _WIN32
15+
#define FLB_TESTS_CONF_PATH FLB_TESTS_DATA_PATH "\\data\\config_format\\yaml"
16+
#else
1417
#define FLB_TESTS_CONF_PATH FLB_TESTS_DATA_PATH "/data/config_format/yaml"
18+
#endif
19+
1520
#define FLB_000 FLB_TESTS_CONF_PATH "/fluent-bit.yaml"
1621
#define FLB_001 FLB_TESTS_CONF_PATH "/issue_7559.yaml"
1722
#define FLB_002 FLB_TESTS_CONF_PATH "/processors.yaml"
23+
#define FLB_000_WIN FLB_TESTS_CONF_PATH "\\fluent-bit-windows.yaml"
24+
25+
#ifdef _WIN32
26+
#define FLB_BASIC FLB_000_WIN
27+
#else
28+
#define FLB_BASIC FLB_000
29+
#endif
1830

1931
/*
2032
* Configurations to test:
@@ -39,7 +51,7 @@ static void test_basic()
3951
struct cfl_variant *v;
4052
int idx = 0;
4153

42-
cf = flb_cf_yaml_create(NULL, FLB_000, NULL, 0);
54+
cf = flb_cf_yaml_create(NULL, FLB_BASIC, NULL, 0);
4355
TEST_CHECK(cf != NULL);
4456
if (!cf) {
4557
exit(EXIT_FAILURE);
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
env:
2+
flush_interval: 1
3+
4+
includes:
5+
- service-windows.yaml
6+
7+
customs:
8+
- name: ${observability}
9+
api_key: zyJUb2tlbklEItoiY2ZlMTcx
10+
11+
pipeline:
12+
inputs:
13+
- name: tail
14+
path: ./test.log
15+
parser: json
16+
read_from_head: true
17+
- name: tail
18+
path: ./test.log
19+
parser: json
20+
read_from_head: true
21+
22+
filters:
23+
- name: record_modifier
24+
match: "*"
25+
record: powered_by calyptia
26+
27+
outputs:
28+
- name: stdout
29+
match: "*"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
env:
2+
observability: calyptia
3+
4+
includes:
5+
- test\nested.yaml

0 commit comments

Comments
 (0)