drun 2.3.4__tar.gz → 2.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {drun-2.3.4 → drun-2.4.2}/PKG-INFO +1 -1
- {drun-2.3.4 → drun-2.4.2}/drun/__init__.py +1 -1
- {drun-2.3.4 → drun-2.4.2}/drun/cli.py +32 -6
- drun-2.4.2/drun/utils/config.py +15 -0
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/PKG-INFO +1 -1
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/SOURCES.txt +1 -0
- {drun-2.3.4 → drun-2.4.2}/pyproject.toml +1 -1
- {drun-2.3.4 → drun-2.4.2}/LICENSE +0 -0
- {drun-2.3.4 → drun-2.4.2}/README.md +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/db/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/db/database_proxy.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/db/generate_mysql_config.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/engine/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/engine/http.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/exporters/curl.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/importers/base.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/importers/curl.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/importers/har.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/importers/openapi.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/importers/postman.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/loader/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/loader/collector.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/loader/env.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/loader/hooks.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/loader/yaml_loader.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/case.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/config.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/report.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/request.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/step.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/models/validators.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/base.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/dingtalk.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/emailer.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/feishu.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/notifier/format.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/reporter/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/reporter/allure_reporter.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/reporter/html_reporter.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/reporter/json_reporter.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/runner/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/runner/assertions.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/runner/extractors.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/runner/runner.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/scaffolds/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/scaffolds/templates.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/templating/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/templating/builtins.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/templating/context.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/templating/engine.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/__init__.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/curl.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/errors.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/logging.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/mask.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun/utils/timeit.py +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/dependency_links.txt +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/entry_points.txt +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/requires.txt +0 -0
- {drun-2.3.4 → drun-2.4.2}/drun.egg-info/top_level.txt +0 -0
- {drun-2.3.4 → drun-2.4.2}/setup.cfg +0 -0
- {drun-2.3.4 → drun-2.4.2}/tests/test_templating.py +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
__all__ = ["__version__"]
|
|
2
|
-
__version__ = "2.
|
|
2
|
+
__version__ = "2.4.2"
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
-
import sys
|
|
5
4
|
import os
|
|
5
|
+
import re
|
|
6
|
+
import sys
|
|
7
|
+
import time
|
|
8
|
+
import unicodedata
|
|
9
|
+
from importlib import metadata as _im
|
|
6
10
|
from pathlib import Path
|
|
7
11
|
from typing import Any, Dict, List, Optional, Tuple
|
|
8
12
|
|
|
9
13
|
import typer
|
|
10
|
-
from importlib import metadata as _im
|
|
11
14
|
import yaml
|
|
12
15
|
|
|
13
16
|
from drun.loader.collector import discover, match_tags
|
|
@@ -23,11 +26,31 @@ from drun.models.report import RunReport
|
|
|
23
26
|
from drun.reporter.json_reporter import write_json
|
|
24
27
|
from drun.runner.runner import Runner
|
|
25
28
|
from drun.templating.engine import TemplateEngine
|
|
29
|
+
from drun.utils.config import get_system_name
|
|
30
|
+
from drun.utils.errors import LoadError
|
|
26
31
|
from drun.utils.logging import setup_logging, get_logger
|
|
27
|
-
import time
|
|
28
32
|
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
def _sanitize_filename_component(value: str, fallback: str) -> str:
|
|
35
|
+
value = (value or "").strip()
|
|
36
|
+
if not value:
|
|
37
|
+
return fallback
|
|
38
|
+
normalized = unicodedata.normalize("NFKC", value)
|
|
39
|
+
invalid_chars = {'<', '>', ':', '"', '/', '\\', '|', '?', '*'}
|
|
40
|
+
cleaned_chars = []
|
|
41
|
+
for ch in normalized.lower():
|
|
42
|
+
if ord(ch) < 32:
|
|
43
|
+
cleaned_chars.append("-")
|
|
44
|
+
continue
|
|
45
|
+
if ch in invalid_chars:
|
|
46
|
+
cleaned_chars.append("-")
|
|
47
|
+
continue
|
|
48
|
+
cleaned_chars.append(ch)
|
|
49
|
+
candidate = "".join(cleaned_chars)
|
|
50
|
+
candidate = re.sub(r"\s+", "-", candidate)
|
|
51
|
+
candidate = re.sub(r"-{2,}", "-", candidate)
|
|
52
|
+
candidate = candidate.strip(" .-")
|
|
53
|
+
return candidate or fallback
|
|
31
54
|
|
|
32
55
|
|
|
33
56
|
def _resolve_env_file_alias(value: str) -> tuple[str, bool, List[str]]:
|
|
@@ -1072,7 +1095,9 @@ def run(
|
|
|
1072
1095
|
"""运行测试用例或测试套件"""
|
|
1073
1096
|
# default log file path
|
|
1074
1097
|
ts = time.strftime("%Y%m%d-%H%M%S")
|
|
1075
|
-
|
|
1098
|
+
system_name = get_system_name()
|
|
1099
|
+
log_component = _sanitize_filename_component(system_name, "run")
|
|
1100
|
+
default_log = log_file or f"logs/{log_component}-{ts}.log"
|
|
1076
1101
|
setup_logging(log_level, log_file=default_log)
|
|
1077
1102
|
log = get_logger("drun.cli")
|
|
1078
1103
|
# unify httpx logs: default suppress, unless enabled
|
|
@@ -1264,7 +1289,8 @@ def run(
|
|
|
1264
1289
|
s.get("steps_skipped", 0),
|
|
1265
1290
|
)
|
|
1266
1291
|
|
|
1267
|
-
|
|
1292
|
+
html_component = _sanitize_filename_component(system_name, "report")
|
|
1293
|
+
html_target = html or f"reports/{html_component}-{ts}.html"
|
|
1268
1294
|
|
|
1269
1295
|
if report:
|
|
1270
1296
|
write_json(report_obj, report)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|