Skip to content

Commit

Permalink
Correctly report why the test_module suite is skipped (#7270)
Browse files Browse the repository at this point in the history
There are 2 reasons why the integration tests for test_modules can be
skipped:

1. We are running ES 2.0
2. We don't have `INTEGRATION_TESTS` set to 1 in our environment.

This commit return the real reason why the modules test are skipped and
give an actionable solution.
  • Loading branch information
ph authored and ruflin committed Jun 6, 2018
1 parent e94ea2b commit 6959076
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions filebeat/tests/system/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ def init(self):
self.index_name = "test-filebeat-modules"

@parameterized.expand(load_fileset_test_cases)
@unittest.skipIf(not INTEGRATION_TESTS or
os.getenv("TESTING_ENVIRONMENT") == "2x",
@unittest.skipIf(not INTEGRATION_TESTS,
"integration tests are disabled, run with INTEGRATION_TESTS=1 to enable them.")
@unittest.skipIf(os.getenv("TESTING_ENVIRONMENT") == "2x",
"integration test not available on 2.x")
def test_fileset_file(self, module, fileset, test_file):
self.init()
Expand Down Expand Up @@ -169,8 +170,9 @@ def run_on_file(self, module, fileset, test_file, cfgfile):
if os.path.exists(test_file + "-expected.json"):
self._test_expected_events(module, test_file, res, objects)

@unittest.skipIf(not INTEGRATION_TESTS or
os.getenv("TESTING_ENVIRONMENT") == "2x",
@unittest.skipIf(not INTEGRATION_TESTS,
"integration tests are disabled, run with INTEGRATION_TESTS=1 to enable them.")
@unittest.skipIf(os.getenv("TESTING_ENVIRONMENT") == "2x",
"integration test not available on 2.x")
def test_input_pipeline_config(self):
"""
Expand Down Expand Up @@ -233,8 +235,9 @@ def search_objects():
o = objects[0]
assert o["x-pipeline"] == "test-pipeline"

@unittest.skipIf(not INTEGRATION_TESTS or
os.getenv("TESTING_ENVIRONMENT") == "2x",
@unittest.skipIf(not INTEGRATION_TESTS,
"integration tests are disabled, run with INTEGRATION_TESTS=1 to enable them.")
@unittest.skipIf(os.getenv("TESTING_ENVIRONMENT") == "2x",
"integration test not available on 2.x")
def test_ml_setup(self):
""" Test ML are installed in all possible ways """
Expand Down

0 comments on commit 6959076

Please sign in to comment.