Commit 4a947b59 authored by wangmeng's avatar wangmeng

Default Changelist

parent 2e2f0b00
...@@ -96,6 +96,7 @@ class ApiSerializer(serializers.ModelSerializer): ...@@ -96,6 +96,7 @@ class ApiSerializer(serializers.ModelSerializer):
instance.data = validated_data.get('data', instance.data) instance.data = validated_data.get('data', instance.data)
instance.description = validated_data.get('description', instance.description) instance.description = validated_data.get('description', instance.description)
instance.expect_code = validated_data.get('expect_code', instance.expect_code) instance.expect_code = validated_data.get('expect_code', instance.expect_code)
instance.headers = validated_data.get('headers', instance.headers)
instance.expect_content = validated_data.get('expect_content', instance.expect_content) instance.expect_content = validated_data.get('expect_content', instance.expect_content)
instance.save() instance.save()
# 删除api的全局参数和用例API的响应参数提取再新增 # 删除api的全局参数和用例API的响应参数提取再新增
......
[uwsgi] [uwsgi]
chdir = /app chdir = /app
wsgi-file = fusionTest/wsgi.py wsgi-file = lwjTest/wsgi.py
master = True master = True
processes = 4 processes = 4
harakiri = 7200 harakiri = 7200
......
...@@ -18,7 +18,7 @@ BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ...@@ -18,7 +18,7 @@ BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# import django # import django
# django.setup() # django.setup()
import datetime
def get_discover(): def get_discover():
report_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime()) report_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
test_suite = unittest.defaultTestLoader.discover("utils", pattern='testGenerateManyCase.py') test_suite = unittest.defaultTestLoader.discover("utils", pattern='testGenerateManyCase.py')
...@@ -36,6 +36,8 @@ def get_discover(): ...@@ -36,6 +36,8 @@ def get_discover():
) )
curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径 curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径
yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址 yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址
today = datetime.datetime.now().replace(microsecond=0)
times = today - datetime.timedelta(days=0)
data = { data = {
"project_name":"fusion_report-{}".format(report_time), "project_name":"fusion_report-{}".format(report_time),
"project_host":"staging", "project_host":"staging",
...@@ -43,9 +45,9 @@ def get_discover(): ...@@ -43,9 +45,9 @@ def get_discover():
"case_all":result.testsRun, "case_all":result.testsRun,
"case_pass":result.success_count, "case_pass":result.success_count,
"case_fail":result.failure_count, "case_fail":result.failure_count,
"start_time":result.begin_time, "start_time":str(times),
"run_time":result.fields['totalTime'], "run_time":result.fields['totalTime'],
"report_details":HOST+"/report/fusion_http_report-{}.html/".format(report_time) "report_details":HOST+"/report/fusion_http_report-{}.html".format(report_time)
} }
with open(yamlpath, 'w', encoding='utf-8') as f: with open(yamlpath, 'w', encoding='utf-8') as f:
yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True) yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True)
......
...@@ -7,7 +7,7 @@ from BeautifulReport import BeautifulReport ...@@ -7,7 +7,7 @@ from BeautifulReport import BeautifulReport
from lwjTest.settings import * from lwjTest.settings import *
BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import os import os
import datetime
# if not os.environ.get('DJANGO_SETTINGS_MODULE'): # if not os.environ.get('DJANGO_SETTINGS_MODULE'):
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo3.settings') # os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo3.settings')
...@@ -33,6 +33,8 @@ def get_discover(): ...@@ -33,6 +33,8 @@ def get_discover():
) )
curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径 curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径
yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址 yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址
today = datetime.datetime.now().replace(microsecond=0)
times = today - datetime.timedelta(days=0)
data = { data = {
"project_name":"fusion_report-{}".format(report_time), "project_name":"fusion_report-{}".format(report_time),
"project_host":"staging", "project_host":"staging",
...@@ -40,9 +42,9 @@ def get_discover(): ...@@ -40,9 +42,9 @@ def get_discover():
"case_all":result.testsRun, "case_all":result.testsRun,
"case_pass":result.success_count, "case_pass":result.success_count,
"case_fail":result.failure_count, "case_fail":result.failure_count,
"start_time":result.begin_times, "start_time":str(times),
"run_time":result.fields['totalTime'], "run_time":result.fields['totalTime'],
"report_details":HOST + "/lwjTest/templates/report/fusion_http_report-{}.html".format(report_time) "report_details":HOST + "/report/fusion_http_report-{}.html".format(report_time)
} }
with open(yamlpath, 'w', encoding='utf-8') as f: with open(yamlpath, 'w', encoding='utf-8') as f:
yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True) yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True)
......
...@@ -7,7 +7,7 @@ from BeautifulReport import BeautifulReport ...@@ -7,7 +7,7 @@ from BeautifulReport import BeautifulReport
from lwjTest.settings import * from lwjTest.settings import *
BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_PATH=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import os import os
import datetime
# if not os.environ.get('DJANGO_SETTINGS_MODULE'): # if not os.environ.get('DJANGO_SETTINGS_MODULE'):
# os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo3.settings') # os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'demo3.settings')
...@@ -32,7 +32,8 @@ def get_discover(): ...@@ -32,7 +32,8 @@ def get_discover():
) )
curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径 curpath = os.path.dirname(os.path.realpath(__file__)) # 获取文件当前路径
yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址 yamlpath = os.path.join(curpath, "case.yaml") # 获取yaml文件地址
logger.info(result.begin_times) today = datetime.datetime.now().replace(microsecond=0)
times = today - datetime.timedelta(days=0)
data = { data = {
"project_name":"fusion_report-{}".format(report_time), "project_name":"fusion_report-{}".format(report_time),
"project_host":"staging", "project_host":"staging",
...@@ -41,9 +42,9 @@ def get_discover(): ...@@ -41,9 +42,9 @@ def get_discover():
"case_pass":result.success_count, "case_pass":result.success_count,
"case_fail":result.failure_count, "case_fail":result.failure_count,
# "start_time":result.begin_times, # "start_time":result.begin_times,
"start_time": "2022/5/23 10:00:00", "start_time": str(times),
"run_time":result.fields['totalTime'], "run_time":result.fields['totalTime'],
"report_details":HOST + "/lwjTest/templates/report/fusion_http_report-{}.html".format(report_time) "report_details":HOST + "/report/fusion_http_report-{}.html".format(report_time)
} }
with open(yamlpath, 'w', encoding='utf-8') as f: with open(yamlpath, 'w', encoding='utf-8') as f:
yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True) yaml.dump(data, f, Dumper=yaml.RoundTripDumper,allow_unicode=True)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment