diff --git a/httprunner/api.py b/httprunner/api.py index d829a207..67b4b942 100644 --- a/httprunner/api.py +++ b/httprunner/api.py @@ -201,6 +201,7 @@ class HttpRunner(object): ) testcase_summary["log"] = logs_file_abs_path + testcase_summary["HRUN-Request-ID"] = testcase.runner.hrun_request_id summary["details"].append(testcase_summary) return summary diff --git a/httprunner/runner.py b/httprunner/runner.py index 9e90303e..71e2f723 100644 --- a/httprunner/runner.py +++ b/httprunner/runner.py @@ -75,6 +75,8 @@ class Runner(object): self.hrun_request_id = str(uuid.uuid4()) if "HRUN-Request-ID" not in config_variables: config_variables["HRUN-Request-ID"] = self.hrun_request_id + else: + self.hrun_request_id = config_variables["HRUN-Request-ID"] # testcase setup hooks testcase_setup_hooks = config.get("setup_hooks", [])