Skip to content

Commit

Permalink
feat: add test file description in report (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
LakiG committed Mar 30, 2023
1 parent c370e23 commit 250e1f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions compliance_suite/functions/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@ def set_platform_details(self, platform_server: str) -> None:
self.report.set_platform_name(platform_server)
self.report.set_platform_description(f"TES service deployed on the {platform_server}")

def add_phase(self, filename: str) -> Any:
def add_phase(self, filename: str, description: str) -> Any:
"""Add a phase which is individual YAML test file
Args:
filename (str): The YAML Testfile name. The phase will be identified via this name.
description: The YAML Testfile description for a more detailed explanation.
Returns:
(Any): Returns a new phase object
"""

phase = self.report.add_phase()
phase.set_phase_name(f"phase_{filename}")
phase.set_phase_description(f"Running tests for {filename} test file")
phase.set_phase_description(description)
return phase

def generate(self) -> Any:
Expand Down
3 changes: 2 additions & 1 deletion compliance_suite/job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ def run_jobs(self) -> None:
logger.log(LOGGING_LEVEL['SUMMARY'], "\n{:#^100}".format(f" Initiating Test-{self.test_count}"
f" for {yaml_file} "))

report_phase = self.report.add_phase(yaml_file.split("/")[-1])
yaml_data: Any = None
report_job_test: Any = None
try:
Expand All @@ -188,6 +187,8 @@ def run_jobs(self) -> None:
if self.report.platform_name == "":
self.report.set_platform_details(self.server)

report_phase = self.report.add_phase(yaml_file.split("/")[-1], yaml_data["description"])

if self.version_matcher(yaml_data["versions"]) and self.tag_matcher(yaml_data["tags"]):
test_runner = TestRunner(yaml_data["service"], self.server, self.version)
job_count: int = 0
Expand Down

0 comments on commit 250e1f4

Please sign in to comment.