Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to read config file in test_modules.py for filebeat #10182

Closed
kaiyan-sheng opened this issue Jan 18, 2019 · 3 comments
Closed

Add ability to read config file in test_modules.py for filebeat #10182

kaiyan-sheng opened this issue Jan 18, 2019 · 3 comments
Labels
discuss Issue needs further discussion. enhancement Filebeat Filebeat Stalled Team:Integrations Label for the Integrations team technical debt :Testing

Comments

@kaiyan-sheng
Copy link
Contributor

Not sure if this is caused by my lack of knowledge on filebeat, I can't find a way to give a config file for a specific module when running GENERATE=1 INTEGRATION_TESTS=1 TESTING_FILEBEAT_MODULES=nginx nosetests -v --nocapture tests/system/test_modules.py.
Right now Im adding hardcoded part into test_modules.py https://github.com/elastic/beats/blob/master/filebeat/tests/system/test_modules.py#L110 to specify variables such as convert.timezone=true to run tests.

Maybe similar to -expected.json, we can have -config.yml and if -config.yml exists, use it as config file when running the tests.

@kaiyan-sheng kaiyan-sheng added enhancement discuss Issue needs further discussion. Filebeat Filebeat Team:Integrations Label for the Integrations team labels Jan 18, 2019
@ruflin
Copy link
Contributor

ruflin commented Jan 21, 2019

@kaiyan-sheng +1 on this idea. There is at the moment not good way to do this.

@webmat
Copy link
Contributor

webmat commented Jan 24, 2019

Flexibility to specify a test matrix would be awesome.

A simple yaml file similar to what Kitchen.ci supports:

- suites:
  - default: ~                       # Runs the tests as they run now.
                                     # If test matrix file is absent, run things like right now too
  - timezone_tests:
    - files:                         # limit files used for this test
      - "*-timezone-*.log"
    - config:                        # config overrides
      - convert_timezone: true
    - event:                         # event overrides
      - event.timezone: EST
  - my_plain_log_tests:
    - config:
      - format: plain

Second test suite example would be enough to handle two types of logs like the Logstash module, where there's two pipeline and logs sets, for: "plain" and "json" formatted logs. Right now @ruflin added some very specific code to address the plain/json pattern.

  • By default all logs are considered by a test, but you can limit via an array of globs
  • By default, configs are at their default values, but you can override
  • By default, events are processed as is, but may be useful to be able to specify an override, for very specific tests (to be seen, if actually needed)

@botelastic
Copy link

botelastic bot commented Jul 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@botelastic botelastic bot added the Stalled label Jul 8, 2020
@botelastic botelastic bot closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issue needs further discussion. enhancement Filebeat Filebeat Stalled Team:Integrations Label for the Integrations team technical debt :Testing
Projects
None yet
Development

No branches or pull requests

4 participants