File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 44
44
- name : Install tox
45
45
run : pip install tox
46
46
47
- - name : Test Execution
48
- run : tox -e py
47
+ - name : Debug Test Execution
48
+ run : tox -e py39 -- -s tests/searchcommands/test_csc_apps. py
49
49
fossa-scan :
50
50
uses : splunk/oss-scanning-public/.github/workflows/oss-scan.yml@main
51
51
secrets : inherit
Original file line number Diff line number Diff line change @@ -327,6 +327,7 @@ def _parse_results(self, stream):
327
327
if strip_line .__len__ () == 0 :
328
328
continue
329
329
parsed_line = json_loads (strip_line )
330
+ print (f"JSONResultReader: Parsed line: { parsed_line } " )
330
331
if "preview" in parsed_line :
331
332
self .is_preview = parsed_line ["preview" ]
332
333
if "messages" in parsed_line and parsed_line ["messages" ].__len__ () > 0 :
Original file line number Diff line number Diff line change 14
14
# License for the specific language governing permissions and limitations
15
15
# under the License.
16
16
17
+ import logging
17
18
import unittest
18
19
import pytest
19
20
21
+ import splunklib
20
22
from tests import testlib
21
23
from splunklib import results
22
24
25
+ splunklib .setup_logging (logging .DEBUG )
26
+
23
27
24
28
@pytest .mark .smoke
25
29
class TestCSC (testlib .SDKTestCase ):
@@ -64,13 +68,29 @@ def test_eventing_app(self):
64
68
self .assertEqual (state .title , "eventing_app" )
65
69
66
70
jobs = self .service .jobs
71
+
72
+ test_index_stream = jobs .oneshot (
73
+ 'search index="_internal" | head 10' , output_mode = 'json'
74
+ )
75
+ test_reader = results .JSONResultsReader (test_index_stream )
76
+ test_items = list (test_reader )
77
+
78
+ print ("DEBUG: Test items from _internal index stream:" )
79
+ for item in test_items :
80
+ print (item )
81
+
67
82
stream = jobs .oneshot (
68
83
'search index="_internal" | fields status | head 4000 | eventingcsc status=200 | head 10' ,
69
84
output_mode = 'json' ,
70
85
)
86
+
71
87
reader = results .JSONResultsReader (stream )
72
88
items = list (reader )
73
89
90
+ print ("DEBUG: Items from eventingcsc command:" )
91
+ for item in items :
92
+ print (item )
93
+
74
94
actual_results = [item for item in items if isinstance (item , dict )]
75
95
informational_messages = [
76
96
item for item in items if isinstance (item , results .Message )
You can’t perform that action at this time.
0 commit comments