|
|
@@ -17,6 +17,14 @@ from zoneinfo import ZoneInfo
|
|
|
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
|
|
|
|
|
|
|
|
+def _load_project_env() -> None:
|
|
|
+ try:
|
|
|
+ from dotenv import load_dotenv
|
|
|
+ except ImportError:
|
|
|
+ return
|
|
|
+ load_dotenv(Path(__file__).parent.parent.parent / ".env")
|
|
|
+
|
|
|
+
|
|
|
def _default_output_root(execution_id: int) -> Path:
|
|
|
ts = datetime.now(ZoneInfo("Asia/Shanghai")).strftime("%Y%m%d_%H%M%S")
|
|
|
return Path(__file__).parent / "test_output_data" / f"execution_{execution_id}_{ts}"
|
|
|
@@ -83,6 +91,7 @@ def parse_args() -> argparse.Namespace:
|
|
|
|
|
|
|
|
|
async def async_main() -> dict:
|
|
|
+ _load_project_env()
|
|
|
args = parse_args()
|
|
|
output_root = _resolve_output_root(args.execution_id, args.run_id, args.output_root)
|
|
|
_configure_local_env(args.execution_id, output_root)
|