Skip to content

Commit d24f893

Browse files
committed
minor changes to printouts.
fixed possible serialization issue when writing test_plan file
1 parent bb75f72 commit d24f893

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ def execute(self):
395395
try:
396396
self.test_detection(detection)
397397
except ContainerStoppedException:
398-
self.pbar.write(f"Stopped container [{self.get_name()}]")
398+
self.pbar.write(f"Warning - container was stopped when trying to execute detection [{self.get_name()}]")
399399
self.finish()
400400
return
401401
except Exception as e:
@@ -1356,7 +1356,7 @@ def status(self):
13561356
pass
13571357

13581358
def finish(self):
1359-
self.pbar.bar_format = f"Stopped container [{self.get_name()}]"
1359+
self.pbar.bar_format = f"Finished running tests on instance: [{self.get_name()}]"
13601360
self.pbar.update()
13611361
self.pbar.close()
13621362

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructureContainer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def removeContainer(self, removeVolumes: bool = True, forceRemove: bool = True):
150150
# container was found, so now we try to remove it
151151
# v also removes volumes linked to the container
152152
container.remove(v=removeVolumes, force=forceRemove)
153+
print(f"container [{self.get_name()}] successfully removed")
154+
153155
# remove it even if it is running. remove volumes as well
154156
# No need to print that the container has been removed, it is expected behavior
155157

contentctl/objects/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,10 @@ def dumpCICDPlanAndQuit(self, githash: str, detections:List[Detection]):
591591
data['githash'] = str(githash)
592592

593593
#Remove some fields that are not relevant
594-
del(data['container_settings'])
594+
for k in ['container_settings', 'test_instances']:
595+
if k in data:
596+
del(data[k])
597+
595598

596599

597600
try:

0 commit comments

Comments
 (0)