Skip to content

Commit

Permalink
style: 调整用例详情页基础布局
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiaolulu committed Sep 27, 2024
1 parent 28fafbf commit 0c91752
Show file tree
Hide file tree
Showing 9 changed files with 4,400 additions and 90,786 deletions.
62 changes: 27 additions & 35 deletions unit-backend/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions unit-backend/api/dao/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from api.services.executor import ExecutorServiceClient

executor_service_client = ExecutorServiceClient()
9 changes: 3 additions & 6 deletions unit-backend/api/dao/https.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from channels.db import database_sync_to_async
from django.db.models import Q
from django.forms import model_to_dict
from api.dao import executor_service_client
from api.dao.report import ReportDao
from api.emus import treesEnum
from api.emus.HttpEnum import (
Expand All @@ -26,7 +27,6 @@
ApiCopy
)
from api.models.project import Project
from api.services.executor import ExecutorServiceClient
from unitrunner.engine.base import (
run_test,
run_api
Expand All @@ -40,9 +40,6 @@
)


executor_service = ExecutorServiceClient()


class HttpDao:

@staticmethod
Expand Down Expand Up @@ -243,7 +240,7 @@ async def run_api_doc(cls, api: dict):
try:
api = HandelTestData(api)
api_data = api.get_api_template()
result = await executor_service.run_api_doc(api_data)
result = await executor_service_client.run_api_doc(api_data)
return result
except Exception as err:
logger.debug(
Expand Down Expand Up @@ -424,7 +421,7 @@ async def run_case_steps(cls, data: dict):
steps = data.get('step_data', [])
name = data.get('name', 'Demo')
case_data = runner.get_case_template(steps, name)
result = await executor_service.run_case(case_data)
result = await executor_service_client.run_case(case_data)
return result
except Exception as e:
logger.debug(
Expand Down
2 changes: 1 addition & 1 deletion unit-backend/api/management/commands/initmenus.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def handle(self, *args, **options):
name='caseDetail',
path='/case/detail',
component="/https/case/components/detail.vue",
title="接口详情",
title="用例详情",
hidden=True,
icon="ElementPlus",
parent_id=http_main_menu.id
Expand Down
3 changes: 2 additions & 1 deletion unit-backend/api/services/executor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio
import time
import grpc
from api.services import ServiceConsul
from api.services.protos import (
Expand Down Expand Up @@ -41,7 +43,6 @@ async def run_api_doc(self, api_doc):
return response

async def run_case(self, case_data):

async with ExecutorStub() as stub:
request = executor_pb2.CaseRequest(
**case_data
Expand Down
Loading

0 comments on commit 0c91752

Please sign in to comment.