Skip to content

Export to DB results in local timezone for test_runs.started_at and test_runs.finished_at (and others) #11

@trwm

Description

@trwm

Since output.xml is generated with local time, but without timezone information, dbbot could/should adjust all times to UTC.
For test_runs.imported_at this is already done by using:
'imported_at': datetime.utcnow()

However test_runs.started_at, test_runs.finished_at and other fields are stored without adjustment and therefore they are stored in local time. This leads to problems when further processing the data, since some information is stored in UTC and others is stored in local time.

Suggest to adjust _format_robot_timestamp(timestamp) (robot_results_parser.py) to e.g.:
return datetime.strptime(timestamp, '%Y%m%d %H:%M:%S.%f').astimezone(timezone.utc) if timestamp else None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions