qdyxmas's Room

Done is better than perfect...

禅道统计bug

select count(case when openedDate>=20181215 and openedDate<=20190103 then id end) as "w1", count(case when openedDate>=20190104 and openedDate<=20190115 then id end) as "w2",
count(case when openedDate>=20190116 and openedDate<=20190210 then id end) as "w3",
count(case when openedDate>=20190211 and openedDate<=20190222 then id end) as "w4",
count(case when openedDate>=20190223 and openedDate<=20190303 then id end) as "w5",
count(case when openedDate>=20190304 and openedDate<=20190317 then id end) as "w6",
count(case when openedDate>=20190318 and openedDate<=20190324 then id end) as "w7",
count(case when openedDate>=20190325 then id end) as "w8" from zt_bug

阅读全文 »

pytest+allure+katalon+UI

https://www.missshi.cn/api/view/blog/5af97f3613d85b1617000000 https://docs.pytest.org/en/latest/ https://www.allure.com/ https://docs.pytest.org/en/latest/#documentation

阅读全文 »

重新拉取分支执行

拉取分支

git fetch
git checkout -b dev origin/dev  ;dev为本地分支 origin/dev为远程分支名    
git pull origin

python3 testrun_tmp.py 9217092b0a6bd6750349d395cde8b5e80e55dc05 2795 origin/feature/wyy_jiazhaoye_data test_backend

阅读全文 »

grpc性能测试工具ghz

CAD

cad_processor

Download:

    ghz  --insecure  --proto cad_processor.proto --call cad_processor.service.CadProcessor.Download -d '{"source_file":"","geometry_entity_list":{},"text_entity_list":{}}' 10.0.0.131:8102

Upload:

    ghz  --insecure  --proto cad_processor.proto --call cad_processor.service.CadProcessor.Upload -d '{"source_file":"cad_processor.proto"}' 10.0.0.131:8102

ConnectionTest:

    ghz  --insecure  --proto cad_processor.proto --call cad_processor.service.CadProcessor.ConnectionTest -d '' 10.0.0.131:8102

Ping:

    ghz  --insecure  --proto cad_processor.proto --call cad_processor.service.CadProcessor.Ping -d '{"current_timestamp":1}' 10.0.0.131:8102

PPT

ppt_service

GeneratePpt

    ghz  --insecure  --proto ppt_service.proto --call ppt_service.service.PptService.GeneratePpt -d '{"title":"","template_name":"","legal_entity_name":"","plans":{},"project":{},"divisions":{},"base_multipolygon_wkt":"","task_id":1,"plans_imgs_data_urls":"","map_imgs_data_urls":"","echarts_imgs_data_urls":"","recommended_plan_json":"{}","recommended_project_json":"{}","recommended_residences_json":"{}"}' 10.0.0.131:7749

Ping

    ghz  --insecure  --proto ppt_service.proto --call ppt_service.service.PptService.Ping -d '{"current_timestamp":1}' 10.0.0.131:7749

task center

task_center

poolTask:

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.PoolTask -d '{"task_name":"1","priority":3,"arguments":"{}","pool_name":""}' 10.0.0.131:7000

BroadcastTask

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.BroadcastTask -d '{"task_name":"1","arguments":"{}","topic_name":""}' 10.0.0.131:7000

CancelTask

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.CancelTask -d '{"task_id":"1","topic_name":""}' 10.0.0.131:7000

QueryTaskStatus

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.QueryTaskStatus -d '{"task_ids":1}' 10.0.0.131:7000

UpdateTaskStatus

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.UpdateTaskStatus -d '{"task_id":1,"current_state":"","info":"","description":""}' 10.0.0.131:7000

RedoTask

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.RedoTask -d '{"task_id":1}' 10.0.0.131:7000

Ping

ghz  --insecure  --proto task_center.proto --call task_center.service.TaskCenter.Ping -d '{"current_timestamp":1}' 10.0.0.131:7000

阅读全文 »

使用python查看https证书到期时间

# coding: utf-8 
# 查询域名证书到期情况

import re
import time
import subprocess
from datetime import datetime
from io import StringIO

def main(domain):
    f = StringIO()
    comm = f"curl -Ivs https://{} --connect-timeout 10".format(domain)

    result = subprocess.getstatusoutput(comm)
    f.write(result[1])

    m = re.search('start date: (.*?)\n.*?expire date: (.*?)\n.*?common name: (.*?)\n.*?issuer: CN=(.*?)\n', f.getvalue(), re.S)
    start_date = m.group(1)
    expire_date = m.group(2)
    common_name = m.group(3)
    issuer = m.group(4)

    # time 字符串转时间数组
    start_date = time.strptime(start_date, "%b %d %H:%M:%S %Y GMT")
    start_date_st = time.strftime("%Y-%m-%d %H:%M:%S", start_date)
    # datetime 字符串转时间数组
    expire_date = datetime.strptime(expire_date, "%b %d %H:%M:%S %Y GMT")
    expire_date_st = datetime.strftime(expire_date,"%Y-%m-%d %H:%M:%S")

    # 剩余天数
    remaining = (expire_date-datetime.now()).days

    print ('域名:', domain)
    print ('通用名:', common_name)
    print ('开始时间:', start_date_st)
    print ('到期时间:', expire_date_st)
    print (f'剩余时间: {remaining}天')
    print ('颁发机构:', issuer)
    print ('*'*30)

    time.sleep(0.5)

if __name__ == "__main__":
    domains = ['www.baidu.com', 'www.jd.com'] 
    for domain in domains:
        main(domain)

阅读全文 »