fix: ftest upload payload and route building
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Aravinth Manivannan 2023-09-28 22:27:33 +05:30
parent ec2eabe19b
commit e2ddad2a24
Signed by: realaravinth
GPG key ID: F8F50389936984FF

12
run.py
View file

@ -139,19 +139,23 @@ def upload_logs_to_ftest(success: bool, logs: str):
( (
parsed_ftest_host.scheme, parsed_ftest_host.scheme,
parsed_ftest_host.netloc, 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( res = requests.post(
FTEST_HOST, json=payload, headers={"Origin": "http://example.org"} FTEST_HOST, json=payload, headers={"Origin": "http://example.org"}
) )
if res.status_code == 200:
logger.info("Upload successful") logger.info("Upload successful")
else:
print(res)
if __name__ == "__main__": if __name__ == "__main__":