Skip to content

Commit e90588b

Browse files
author
Cecylia Borek
committed
debug: csc test
1 parent 2b63865 commit e90588b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

splunklib/results.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ def _parse_results(self, stream):
327327
if strip_line.__len__() == 0:
328328
continue
329329
parsed_line = json_loads(strip_line)
330+
print(f"JSONResultReader: Parsed line: {parsed_line}")
330331
if "preview" in parsed_line:
331332
self.is_preview = parsed_line["preview"]
332333
if "messages" in parsed_line and parsed_line["messages"].__len__() > 0:

tests/searchcommands/test_csc_apps.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17+
import logging
1718
import unittest
1819
import pytest
1920

21+
import splunklib
2022
from tests import testlib
2123
from splunklib import results
2224

25+
splunklib.setup_logging(logging.DEBUG)
26+
2327

2428
@pytest.mark.smoke
2529
class TestCSC(testlib.SDKTestCase):
@@ -68,9 +72,16 @@ def test_eventing_app(self):
6872
'search index="_internal" | fields status | head 4000 | eventingcsc status=200 | head 10',
6973
output_mode='json',
7074
)
75+
print(f"DEBUG: Stream type: {type(stream)}")
76+
print(f"DEBUG: Stream class name: {stream.__class__.__name__}")
77+
print(f"DEBUG: Stream module: {stream.__class__.__module__}")
78+
print(f"DEBUG: Stream repr: {repr(stream)}")
7179
reader = results.JSONResultsReader(stream)
7280
items = list(reader)
7381

82+
for item in items:
83+
print(item)
84+
7485
actual_results = [item for item in items if isinstance(item, dict)]
7586
informational_messages = [
7687
item for item in items if isinstance(item, results.Message)

0 commit comments

Comments
 (0)