Skip to content

Commit 93d689c

Browse files
authored
Merge pull request #185 from splunk/emit_summary_if_no_detections_tested
Emit summary if no detections tested
2 parents 904ed46 + 7b25c2e commit 93d689c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

contentctl/actions/test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ def execute(self, input_dto: TestInputDto) -> bool:
9090

9191
if len(input_dto.detections) == 0:
9292
print(f"With Detection Testing Mode '{input_dto.config.getModeName()}', there were [0] detections found to test.\nAs such, we will quit immediately.")
93+
# Directly call stop so that the summary.yml will be generated. Of course it will not have any test results, but we still want it to contain
94+
# a summary showing that now detections were tested.
95+
file.stop()
9396
else:
9497
print(f"MODE: [{input_dto.config.getModeName()}] - Test [{len(input_dto.detections)}] detections")
9598
if input_dto.config.mode in [DetectionTestingMode.changes, DetectionTestingMode.selected]:
@@ -98,7 +101,7 @@ def execute(self, input_dto: TestInputDto) -> bool:
98101

99102
manager.setup()
100103
manager.execute()
101-
104+
102105
try:
103106
summary_results = file.getSummaryObject()
104107
summary = summary_results.get("summary", {})

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "contentctl"
3-
version = "4.1.0"
3+
version = "4.1.1"
44
description = "Splunk Content Control Tool"
55
authors = ["STRT <[email protected]>"]
66
license = "Apache 2.0"

0 commit comments

Comments
 (0)