From e2ddad2a2478e87cb0d793a134e7d70b6455230e Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 28 Sep 2023 22:27:33 +0530 Subject: [PATCH] fix: ftest upload payload and route building --- run.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/run.py b/run.py index b6685cb..b84acf8 100755 --- a/run.py +++ b/run.py @@ -139,19 +139,23 @@ def upload_logs_to_ftest(success: bool, logs: str): ( parsed_ftest_host.scheme, parsed_ftest_host.netloc, - "/api/v1/results", + f"/api/v1/{FTEST_AUTH}/results", + "", + "", "", - "" "", ) ) - logger.info("Uploading logs to ftest server {ftest}") + logger.info(f"Uploading logs to ftest server {ftest}") - payload = {"success": success, "logs": logs, "auth": FTEST_AUTH} + payload = {"success": success, "logs": logs} res = requests.post( FTEST_HOST, json=payload, headers={"Origin": "http://example.org"} ) - logger.info("Upload successful") + if res.status_code == 200: + logger.info("Upload successful") + else: + print(res) if __name__ == "__main__":