diff --git a/iact3/report/generate_reports.py b/iact3/report/generate_reports.py index 7c170d8..085516f 100644 --- a/iact3/report/generate_reports.py +++ b/iact3/report/generate_reports.py @@ -1,7 +1,6 @@ import asyncio import datetime import json -import xml.etree.ElementTree as ET import xml.dom.minidom as minidom import logging import os @@ -84,6 +83,7 @@ async def generate_report(self): status = stack.status stack_name = stack.name region = stack.region + stack_id = stack.id css = "class=test-green" if status == 'CREATE_COMPLETE' else 'class=test-red' with tag("tr"): @@ -93,7 +93,9 @@ async def generate_report(self): with tag("td", "class=text-left"): text(region) with tag("td", "class=text-left"): - text(stack_name) + ref_url = f"https://ros.console.aliyun.com/{region}/stacks/{stack_id}" + with tag("a", href=ref_url): + text(stack_name) with tag("td", css): text(str(status)) with tag("td", "class=text-left"): @@ -107,6 +109,7 @@ async def generate_report(self): 'TestName': test_name, 'TestedRegion': region, 'StackName': stack_name, + 'StackId': stack.id, 'TestResult': status, 'TestLog': clog, 'Result': 'Success' if success else 'Failed' @@ -250,8 +253,6 @@ async def write_logs(self, stack: Stack, log_path: Path, log_formats: list): log_output.write(xml_doc.toprettyxml(indent="\t")) - - async with aiofiles.open(str(log_path)+'.txt', "a", encoding="utf-8") as log_output: await log_output.write( "------------------------------------------------------------------" diff --git a/iact3/stack.py b/iact3/stack.py index bbe00b1..7e8c6ba 100644 --- a/iact3/stack.py +++ b/iact3/stack.py @@ -130,6 +130,7 @@ async def preview_stacks_result(self): ] self.stacks += await asyncio.gather(*stack_tasks) + def criteria_matches(kwargs: dict, instance): for k in kwargs: if not hasattr(instance, k): diff --git a/setup.py b/setup.py index 0a94024..4b694f8 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setuptools.setup( name="alibabacloud-ros-iact3", - version="0.1.7", + version="0.1.8", description="Iact3 is a tool that tests Terraform and ROS(Resource Orchestration Service) templates.", long_description=long_description,