Skip to content

Commit 126c0fb

Browse files
Merge pull request #166 from splunk/ACD-4521-generate-the-same-test-ids-for-indextime-tests
ACD-4521: Generate the same test ids for indextime tests
2 parents d032798 + 6dd5b19 commit 126c0fb

File tree

2 files changed

+30
-31
lines changed

2 files changed

+30
-31
lines changed

pytest_splunk_addon/standard_lib/sample_generation/eventgen_parser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def get_sample_stanzas(self):
8686
"""
8787
eventgen_dict = self.get_eventgen_stanzas()
8888
self.check_samples()
89-
for sample_name, stanza_params in eventgen_dict.items():
89+
for sample_name, stanza_params in sorted(eventgen_dict.items()):
9090
sample_path = os.path.join(self.path_to_samples, sample_name)
9191
yield SampleStanza(
9292
sample_path, stanza_params,
@@ -118,10 +118,9 @@ def get_eventgen_stanzas(self):
118118
Dictionary representing eventgen.conf in the above format.
119119
"""
120120
eventgen_dict = {}
121-
child_dict = {"tokens": {}}
122121
if os.path.exists(self.path_to_samples):
123122
for sample_file in os.listdir(self.path_to_samples):
124-
for stanza in self.eventgen.sects:
123+
for stanza in sorted(self.eventgen.sects):
125124
stanza_match_obj = re.search(stanza, sample_file)
126125
if stanza_match_obj and stanza_match_obj.group(0) == sample_file:
127126
self.match_stanzas.add(stanza)

tests/constants.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -445,15 +445,17 @@
445445
"""
446446
TA_FICTION_INDEXTIME_PASSED = [
447447
'*test_splunk_fiction_indextime.py::Test_App::test_events_with_untokenised_values* PASSED*',
448-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:file_monitor_host_prefix::test-host_file_monitor_host_prefix.sample_186_to_test-host_file_monitor_host_prefix.sample_188* PASSED*',
448+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:file_monitor_host_prefix::test-host_file_monitor_host_prefix.sample_2_to_test-host_file_monitor_host_prefix.sample_4* PASSED*',
449449
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:file_monitor_time_stamp_plugin::file_monitor_time_stamp_plugin.samples* PASSED*',
450450
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_key_fields_fiction::scripted_input_key_fields_fiction.samples* PASSED*',
451-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_35* PASSED*',
452-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_36* PASSED*',
453-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:file_all_dependent::host_sample_file_three.samples_196_to_host_sample_file_three.samples_202* PASSED*',
451+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_33* PASSED*',
452+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_34* PASSED*',
453+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:file_all_dependent::host_sample_file_three.samples_190_to_host_sample_file_three.samples_196* PASSED*',
454454
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:modinput_host_event_time_plugin::modinput_host_event_time_plugin.samples_1* PASSED*',
455455
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:modinput_host_event_time_plugin::modinput_host_event_time_plugin.samples_2* PASSED*',
456456
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:user_email_relation_time_plugin::sample_file_two.samples* PASSED*',
457+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_13* PASSED*',
458+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_14* PASSED*',
457459
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_15* PASSED*',
458460
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_16* PASSED*',
459461
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_17* PASSED*',
@@ -470,30 +472,30 @@
470472
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_28* PASSED*',
471473
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_29* PASSED*',
472474
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_30* PASSED*',
473-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_13* PASSED*',
474-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample_file.samples_14* PASSED*',
475475
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:postfix:regex:stanza::postfix_test_regex_two.samples_1* PASSED*',
476476
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:postfix:regex:stanza::postfix_test_regex_two.samples_2* PASSED*',
477-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test_scripted_input_sourcetype::host_test_scripted_input_one.samples_33* PASSED*',
478-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test_scripted_input_sourcetype::host_test_scripted_input_one.samples_34* PASSED*',
477+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test_scripted_input_sourcetype::host_test_scripted_input_one.samples_35* PASSED*',
478+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test_scripted_input_sourcetype::host_test_scripted_input_one.samples_36* PASSED*',
479479
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*mcafee:epo:syslog::sc4s_host_plugin_time.sample_31* PASSED*',
480480
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*mcafee:epo:syslog::sc4s_host_plugin_time.sample_32* PASSED*',
481-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:file_monitor_host_prefix::test-host_file_monitor_host_prefix.sample_186_to_test-host_file_monitor_host_prefix.sample_188* PASSED*',
481+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:file_monitor_host_prefix::test-host_file_monitor_host_prefix.sample_2_to_test-host_file_monitor_host_prefix.sample_4* PASSED*',
482482
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_host_prefix::test-modinput_host_prefix.sample_1* PASSED*',
483483
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_host_prefix::test-modinput_host_prefix.sample_2* PASSED*',
484484
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_line_breaker::modinput_line_breaker.samples_1* PASSED*',
485485
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_line_breaker::modinput_line_breaker.samples_2* PASSED*',
486486
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_line_breaker::modinput_line_breaker.samples_3* PASSED*',
487487
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:modinput_line_breaker::modinput_line_breaker.samples_4* PASSED*',
488488
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:scripted_input_key_fields_fiction::scripted_input_key_fields_fiction.samples* PASSED*',
489-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_35* PASSED*',
490-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_36* PASSED*',
491-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:file_all_dependent::host_sample_file_three.samples_196_to_host_sample_file_three.samples_202* PASSED*',
489+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_33* PASSED*',
490+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking_fiction::scripted_input_line_breaking_fiction.samples_34* PASSED*',
491+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:file_all_dependent::host_sample_file_three.samples_190_to_host_sample_file_three.samples_196* PASSED*',
492492
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:updated::test_regex_one.samples_1* PASSED*',
493493
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:updated::test_regex_one.samples_2* PASSED*',
494494
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:updated::test_regex_two.samples_1* PASSED*',
495495
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:updated::test_regex_two.samples_2* PASSED*',
496496
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype:user_email_relation_time_plugin::sample_file_two.samples* PASSED*',
497+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_13* PASSED*',
498+
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_14* PASSED*',
497499
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_15* PASSED*',
498500
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_16* PASSED*',
499501
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_17* PASSED*',
@@ -510,8 +512,6 @@
510512
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_28* PASSED*',
511513
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_29* PASSED*',
512514
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_30* PASSED*',
513-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_13* PASSED*',
514-
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_time*test:indextime:sourcetype_basic::sample_file.samples_14* PASSED*',
515515
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_line_breaker*mcafee:epo:syslog::sc4s_host_plugin_time.sample* PASSED*',
516516
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_line_breaker*test:indextime:file_monitor_host_prefix::file_monitor_host_prefix.sample* PASSED*',
517517
'*test_splunk_fiction_indextime.py::Test_App::test_indextime_line_breaker*test:indextime:file_monitor_line_breaker::file_monitor_line_breaker_sample.samples* PASSED*',
@@ -578,8 +578,8 @@
578578
"""
579579
TA_FICTION_INDEXTIME_BROKEN_PASSED = [
580580
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*mcafee:epo:syslog::wrong_sc4s_tokens.sample* PASSED*',
581-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_1* PASSED*',
582-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_2* PASSED*',
581+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_3* PASSED*',
582+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_4* PASSED*',
583583
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:skip_token_or_empty_line::skip_token_or_empty_line.samples_1* PASSED*',
584584
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:skip_token_or_empty_line::skip_token_or_empty_line.samples_2* PASSED*',
585585
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:skip_token_or_empty_line::skip_token_or_empty_line.samples_3* PASSED*',
@@ -606,35 +606,35 @@
606606
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:wrong_timezone::wrong_timezone.samples* PASSED*',
607607
'*test_splunk_fiction_indextime_broken.py::Test_App::test_cim_fields_not_allowed_in_props*searchtime_cim_fields* PASSED*',
608608
'*test_splunk_fiction_indextime_broken.py::Test_App::test_eventtype_mapped_multiple_cim_datamodel*mapped_datamodel_tests* PASSED*',
609-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_splunk_internal_errors PASSED*',
609+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_splunk_internal_errors PASSED *',
610610
]
611611
"""
612612
Define the TA_fiction_indextime_broken add-on failed test case list.
613613
"""
614614
TA_FICTION_INDEXTIME_BROKEN_FAILED = [
615615
'*test_splunk_fiction_indextime_broken.py::Test_App::test_events_with_untokenised_values FAILED*',
616-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:failing::failing.samples_3* FAILED*',
617-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:failing::failing.samples_4* FAILED*',
618-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:file_monitor_host_prefix::test1-host_wrong_prefix_filemonitor.sample_212_to_test1-host_wrong_prefix_filemonitor.sample_214* FAILED*',
616+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:failing::failing.samples_1* FAILED*',
617+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:failing::failing.samples_2* FAILED*',
618+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:file_monitor_host_prefix::test1-host_wrong_prefix_filemonitor.sample_218_to_test1-host_wrong_prefix_filemonitor.sample_220* FAILED*',
619619
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_key_fields*test:indextime:scripted_input_key_fields::scripted_input_key_fields.samples* FAILED*',
620-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:failing::failing.samples_3* FAILED*',
621-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:failing::failing.samples_4* FAILED*',
622-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:file_monitor_host_prefix::test1-host_wrong_prefix_filemonitor.sample_212_to_test1-host_wrong_prefix_filemonitor.sample_214* FAILED*',
620+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:failing::failing.samples_1* FAILED*',
621+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:failing::failing.samples_2* FAILED*',
622+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:file_monitor_host_prefix::test1-host_wrong_prefix_filemonitor.sample_218_to_test1-host_wrong_prefix_filemonitor.sample_220* FAILED*',
623623
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:no_host_provided_when_type_event::no_host_provided_when_type_event.samples* FAILED*',
624624
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:no_prefix_stanza_modinput::no_prefix_stanza_modinput.sample_1* FAILED*',
625625
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:no_prefix_stanza_modinput::no_prefix_stanza_modinput.sample_2* FAILED*',
626626
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:no_time_provided_when_type_event::no_time_provided_when_type_event.samples* FAILED*',
627627
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:scripted_input_key_fields::scripted_input_key_fields.samples* FAILED*',
628-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_1* FAILED*',
629-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_2* FAILED*',
628+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_3* FAILED*',
629+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples_4* FAILED*',
630+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:wrong_line_breaker_modinput::wrong_line_breaker_modinput.samples_1* FAILED*',
630631
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:wrong_timezone::wrong_timezone.samples* FAILED*',
631632
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:failing::failing.samples* FAILED*',
632633
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:file_monitor_host_prefix::wrong_prefix_filemonitor.sample* FAILED*',
633-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples* FAILED*',
634-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:wrong_line_breaker_file_monitor::wrong_line_breaker_file_monitor.samples* FAILED*',
635634
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:no_host_provided_when_type_event::no_host_provided_when_type_event.samples* FAILED*',
636635
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:no_prefix_stanza_modinput::no_prefix_stanza_modinput.sample* FAILED*',
637-
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_time*test:indextime:wrong_line_breaker_modinput::wrong_line_breaker_modinput.samples_1* FAILED*',
636+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:scripted_input_line_breaking::scripted_input_line_breaking.samples* FAILED*',
637+
'*test_splunk_fiction_indextime_broken.py::Test_App::test_indextime_line_breaker*test:indextime:wrong_line_breaker_file_monitor::wrong_line_breaker_file_monitor.samples* FAILED*',
638638
]
639639
"""
640640
Define the TA_fiction_indextime_broken add-on skipped test case list.

0 commit comments

Comments
 (0)