From f857607324e560963d962c4fc93573d11bedf42c Mon Sep 17 00:00:00 2001 From: Gil Raphaelli Date: Thu, 23 Aug 2018 12:19:07 -0400 Subject: [PATCH] remove elasticsearch dependency from non-integration tests --- tests/system/apmserver.py | 12 +++++++----- tests/system/test_integration.py | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/system/apmserver.py b/tests/system/apmserver.py index 1bd4247a71d..588f2a26668 100644 --- a/tests/system/apmserver.py +++ b/tests/system/apmserver.py @@ -240,8 +240,7 @@ def check_for_no_smap(self, doc): assert "sourcemap" not in frame -class ClientSideBaseTest(ElasticTest): - +class ClientSideBaseTest(ServerBaseTest): transactions_url = 'http://localhost:8200/v1/rum/transactions' errors_url = 'http://localhost:8200/v1/rum/errors' sourcemap_url = 'http://localhost:8200/v1/rum/sourcemaps' @@ -282,6 +281,8 @@ def upload_sourcemap(self, file_name='bundle_no_mapping.js.map', }) return r + +class ClientSideElasticTest(ClientSideBaseTest, ElasticTest): def wait_for_sourcemaps(self, expected_ct=1): idx = self.smap_index_pattern self.wait_until( @@ -311,7 +312,8 @@ def check_rum_transaction_sourcemap(self, updated, expected_err=None, count=1): span = doc["_source"]["span"] self.check_smap(span, updated, expected_err) - def check_smap(self, doc, updated, err=None): + @staticmethod + def check_smap(doc, updated, err=None): if "stacktrace" not in doc: return for frame in doc["stacktrace"]: @@ -348,14 +350,14 @@ def config(self): return cfg -class SmapCacheBaseTest(ClientSideBaseTest): +class SmapCacheBaseTest(ClientSideElasticTest): def config(self): cfg = super(SmapCacheBaseTest, self).config() cfg.update({"smap_cache_expiration": "1"}) return cfg -class SmapIndexBaseTest(ClientSideBaseTest): +class SmapIndexBaseTest(ClientSideElasticTest): @classmethod def setUpClass(cls): super(SmapIndexBaseTest, cls).setUpClass() diff --git a/tests/system/test_integration.py b/tests/system/test_integration.py index 2b87538470b..c7deb312436 100644 --- a/tests/system/test_integration.py +++ b/tests/system/test_integration.py @@ -2,7 +2,7 @@ import unittest from apmserver import ElasticTest, ExpvarBaseTest -from apmserver import ClientSideBaseTest, SmapIndexBaseTest, SmapCacheBaseTest +from apmserver import ClientSideElasticTest, SmapIndexBaseTest, SmapCacheBaseTest from apmserver import SplitIndicesTest from beat.beat import INTEGRATION_TESTS import json @@ -113,7 +113,7 @@ def dump(self, data): return json.dumps(data, indent=4, separators=(',', ': ')) -class RumEnabledIntegrationTest(ClientSideBaseTest): +class RumEnabledIntegrationTest(ClientSideElasticTest): @unittest.skipUnless(INTEGRATION_TESTS, "integration test") def test_backend_error(self): self.load_docs_with_template(self.get_error_payload_path(name="payload.json"), @@ -257,7 +257,7 @@ def test_split_docs_into_separate_indices(self): assert 5 == ct -class SourcemappingIntegrationTest(ClientSideBaseTest): +class SourcemappingIntegrationTest(ClientSideElasticTest): @unittest.skipUnless(INTEGRATION_TESTS, "integration test") def test_backend_error(self):