Logstash plugin unit tests, strip output and input blocks of config

In my unit tests for my custom logstash plugin, I load in a config file that has input, filter, and output blocks, as normal.

Is there an easy way to somehow load only the filter section of this file, perhaps using the LogStashConfigParser class or similar?

The reason for this is that I wish to be able to load the tests without having to have the input and output plugins installed on the test machine.

Also, I cannot split this file into 3 separate files.

Thanks

In my unit tests for my custom logstash plugin, I load in a config file that has input, filter, and output blocks, as normal.

That doesn't quite sound like unit tests, but okay.

Also, I cannot split this file into 3 separate files.

Why not?

You are correct in saying these are not unit tests, I suppose they are more like integration tests.
I am testing a conf file that I will eventually ship as part of an RPM, and this contains some important version information in it's header that is automatically generated on commit.
Therefor only one file can exist in source control.

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.