Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saves robot logs as .log when reporting error #15113

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion abr-testing/abr_testing/automation/jira_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create_ticket(
}
try:
response = requests.post(
f"{self.url}/rest/api/3/issue/",
f"{self.url}/rest/api/3/issue",
headers=self.headers,
auth=self.auth,
json=data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def get_error_info_from_robot(
board_id = args.board_id[0]
reporter_id = args.reporter_id[0]
ticket = jira_tool.JiraTicket(url, api_token, email)
ticket.issues_on_board(board_id)
try:
error_runs = get_error_runs_from_robot(ip)
except requests.exceptions.InvalidURL:
Expand Down
5 changes: 2 additions & 3 deletions abr-testing/abr_testing/data_collection/read_robot_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,10 @@ def get_logs(storage_directory: str, ip: str) -> List[str]:
)
response.raise_for_status()
log_data = response.text
log_name = ip + "_" + log_type.split(".")[0] + ".json"
log_name = ip + "_" + log_type.split(".")[0] + ".log"
file_path = os.path.join(storage_directory, log_name)
with open(file_path, mode="w", encoding="utf-8") as file:
file.write(response.text)
json.dump(log_data, open(file_path, mode="w"))
file.write(log_data)
except RuntimeError:
print(f"Request exception. Did not save {log_type}")
continue
Expand Down
Loading