Skip to main content

test server exec cmd

Project description

pytest_server

Start service

pytest-server

Usage

import os
import sys

from pytest_server.client import run_tests, upload_allure_results

# 传入外部参数
project_name = sys.argv[1]
build_number = sys.argv[2]
build_url = sys.argv[3]
project_path = os.path.dirname(os.path.abspath(__file__))
# 确定allure测试结果生成路径
result_path = os.path.join(project_path, "allure-results")
result_path_build = os.path.join(result_path, build_number)
# 执行测试
run_tests(
    project_path=project_path,
    build_path=result_path_build
)
# 上传allure结果文件
upload_allure_results(
    password='123456',
    allure_result_path=result_path,
    jenkins_project_path=rf'D:\jenkins\workspace\{project_name}',
    ssh_host='Administrator@192.168.100.18',
    hostkey='AAAAC3NzaC1lZDI1NTE5AAAAIHh2w7oqUW+zfUx75l6DwrKld9DlCWsXfwPkfS+2YycY',
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_server-1.0.1.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

pytest_server-1.0.1-py3-none-any.whl (3.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page