Skip to content

Commit

Permalink
config_format: yaml: test: Make runnable for yaml config on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Hiroshi Hatake <[email protected]>
  • Loading branch information
cosmo0920 authored and edsiper committed Dec 21, 2023
1 parent bc796b2 commit a026bee
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/internal/config_format_yaml.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@

#include "flb_tests_internal.h"

#ifdef _WIN32
#define FLB_TESTS_CONF_PATH FLB_TESTS_DATA_PATH "\\data\\config_format\\yaml"
#else
#define FLB_TESTS_CONF_PATH FLB_TESTS_DATA_PATH "/data/config_format/yaml"
#endif

#define FLB_000 FLB_TESTS_CONF_PATH "/fluent-bit.yaml"
#define FLB_001 FLB_TESTS_CONF_PATH "/issue_7559.yaml"
#define FLB_002 FLB_TESTS_CONF_PATH "/processors.yaml"
#define FLB_000_WIN FLB_TESTS_CONF_PATH "\\fluent-bit-windows.yaml"

#ifdef _WIN32
#define FLB_BASIC FLB_000_WIN
#else
#define FLB_BASIC FLB_000
#endif

/*
* Configurations to test:
Expand All @@ -39,7 +51,7 @@ static void test_basic()
struct cfl_variant *v;
int idx = 0;

cf = flb_cf_yaml_create(NULL, FLB_000, NULL, 0);
cf = flb_cf_yaml_create(NULL, FLB_BASIC, NULL, 0);
TEST_CHECK(cf != NULL);
if (!cf) {
exit(EXIT_FAILURE);
Expand Down
29 changes: 29 additions & 0 deletions tests/internal/data/config_format/yaml/fluent-bit-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
env:
flush_interval: 1

includes:
- service-windows.yaml

customs:
- name: ${observability}
api_key: zyJUb2tlbklEItoiY2ZlMTcx

pipeline:
inputs:
- name: tail
path: ./test.log
parser: json
read_from_head: true
- name: tail
path: ./test.log
parser: json
read_from_head: true

filters:
- name: record_modifier
match: "*"
record: powered_by calyptia

outputs:
- name: stdout
match: "*"
5 changes: 5 additions & 0 deletions tests/internal/data/config_format/yaml/service-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
env:
observability: calyptia

includes:
- test\nested.yaml

0 comments on commit a026bee

Please sign in to comment.