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

refactor: remove test_events_with_untokenised_values from RequirementBasic #543

Merged
2 commits merged into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 2 additions & 41 deletions pytest_splunk_addon/standard_lib/addon_requirements_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,50 +16,11 @@
Base class for requirement test cases.
"""
from .requirement_tests import ReqsTestTemplates
from .cim_tests import FieldTestHelper
import pytest


class RequirementBasic(ReqsTestTemplates):
"""
Base class for requirement test cases.Only implement the common tests here.
Base class for requirement test cases. Only implement the common tests here.
"""

@pytest.mark.splunk_searchtime_requirements
def test_events_with_untokenised_values(
self, splunk_search_util, splunk_ingest_data, splunk_setup, record_property
):
"""
Test case to validate that all the events have been properly tokenised

Args:
splunk_search_util (SearchUtil): Object that helps to search on Splunk.
splunk_ingest_data (fixture): To ingest data into splunk.
record_property (fixture): Document facts of test cases.

"""
query = f"search index=* ##*## | stats count by source, sourcetype"
record_property("Query", query)
results = list(
splunk_search_util.getFieldValuesList(
query,
interval=0,
retries=0,
)
)
if results:
record_property("results", results)
result_str = FieldTestHelper.get_table_output(
headers=["Source", "Sourcetype"],
value_list=[
[
result.get("source"),
result.get("sourcetype"),
]
for result in results
],
)
assert False, (
f"For the query: '{query}'\n"
f"Some fields are not tokenized in the events of following source and sourcetype \n{result_str}"
)
pass
4 changes: 0 additions & 4 deletions tests/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@
Define TA_requirement_tests passed test
"""
TA_REQUIREMENTS_PASSED = [
"*test_splunk_app_requirements.py::Test_App::test_events_with_untokenised_values PASSED*",
"*test_splunk_app_requirements.py::Test_App::test_requirement_params* PASSED*",
]

Expand All @@ -752,7 +751,6 @@
]

TA_REQUIREMENTS_MODINPUT_PASSED = [
"*test_splunk_app_requirements_modinput.py::Test_App::test_events_with_untokenised_values PASSED*",
"*test_splunk_app_requirements_modinput.py::Test_App::test_requirement_params* PASSED*",
]

Expand All @@ -761,7 +759,6 @@
]

TA_REQUIREMENTS_UF_PASSED = [
"*test_splunk_app_requirements_uf.py::Test_App::test_events_with_untokenised_values PASSED*",
"*test_splunk_app_requirements_uf.py::Test_App::test_requirement_params* PASSED*",
]

Expand All @@ -770,7 +767,6 @@
]

TA_REQUIREMENTS_SCRIPTED_PASSED = [
"*test_splunk_app_requirements_scripted.py::Test_App::test_events_with_untokenised_values* PASSED*",
"*test_splunk_app_requirements_scripted.py::Test_App::test_requirement_params* PASSED*",
]

Expand Down