Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add test file description in report #41

Merged
merged 2 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -152,7 +152,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 @@ -170,6 +169,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.tag_matcher(yaml_data["tags"]):
test_runner = TestRunner(yaml_data["service"], self.server, self.version)
job_count: int = 0
Expand Down