Skip to content

Commit

Permalink
Updated test parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick committed Sep 14, 2023
1 parent 451c114 commit 21568f1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions contentctl/actions/detection_testing/GitHubService.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def get_all_content(self, director: DirectorOutputDto) -> DirectorOutputDto:
self.get_macros(director),
self.get_lookups(director),
[],
[]
)

def get_stories(self, director: DirectorOutputDto) -> list[Story]:
Expand Down
2 changes: 2 additions & 0 deletions contentctl/actions/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ def execute(self, input_dto: GenerateInputDto) -> DirectorOutputDto:
api_json_output.writeObjects(director_output_dto.lookups, input_dto.director_input_dto.config.build_api.output_path, SecurityContentType.lookups)
api_json_output.writeObjects(director_output_dto.macros, input_dto.director_input_dto.config.build_api.output_path, SecurityContentType.macros)
api_json_output.writeObjects(director_output_dto.deployments, input_dto.director_input_dto.config.build_api.output_path, SecurityContentType.deployments)

return director_output_dto
24 changes: 12 additions & 12 deletions contentctl/contentctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,21 @@ def test(args: argparse.Namespace):

test = Test()

try:
#try:

result = test.execute(test_input_dto)
# This return code is important. Even if testing
# fully completes, if everything does not pass then
# we want to return a nonzero status code
if result:
sys.exit(0)
else:
sys.exit(1)

except Exception as e:
print(f"Error running contentctl test: {str(e)}")
result = test.execute(test_input_dto)
# This return code is important. Even if testing
# fully completes, if everything does not pass then
# we want to return a nonzero status code
if result:
sys.exit(0)
else:
sys.exit(1)

# except Exception as e:
# print(f"Error running contentctl test: {str(e)}")
# sys.exit(1)


def validate(args) -> None:
config = start(args)
Expand Down

0 comments on commit 21568f1

Please sign in to comment.