-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix pipeline.id with dash * Fix path.config pointing to dir in pipelines.yml Solves issue mentioned in: #93 (comment)
- Loading branch information
Showing
7 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package logstash | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/matryer/is" | ||
) | ||
|
||
func TestExtractPipelines(t *testing.T) { | ||
cases := []struct { | ||
name string | ||
input string | ||
|
||
want []string | ||
}{ | ||
{ | ||
name: "single word pipeline id", | ||
input: `[:output, :stdin, :lfv_output_stdout, :lfv_ukPSsPZk_main, :lfv_input_1]`, | ||
|
||
want: []string{"output", "stdin", "lfv_output_stdout", "lfv_ukPSsPZk_main", "lfv_input_1"}, | ||
}, | ||
{ | ||
name: "pipeline id with dash", | ||
input: `[:output, :stdin, :lfv_output_stdout, :"lfv_ukPSsPZk_main-test", :lfv_input_1]`, | ||
|
||
want: []string{"output", "stdin", "lfv_output_stdout", "lfv_ukPSsPZk_main-test", "lfv_input_1"}, | ||
}, | ||
} | ||
|
||
for _, test := range cases { | ||
t.Run(test.name, func(t *testing.T) { | ||
is := is.New(t) | ||
|
||
got := extractPipelines(test.input) | ||
is.Equal(test.want, got) | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
internal/daemon/pipeline/testdata/pipelines_basic_dir_name.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
- pipeline.id: main | ||
path.config: "folder/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
- pipeline.id: main | ||
path.config: "main/**/*.conf" | ||
- pipeline.id: main-debug | ||
path.config: "main/**/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
- pipeline.id: main | ||
path.config: "main/*.conf" | ||
path.config: "main/" |