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

Timestamp is ignoring timezone offset #98

Open
msaladin opened this issue Sep 7, 2016 · 2 comments
Open

Timestamp is ignoring timezone offset #98

msaladin opened this issue Sep 7, 2016 · 2 comments

Comments

@msaladin
Copy link

msaladin commented Sep 7, 2016

In the generated XML, the timestamp looks like this:
<testsuite ... timestamp="2016-09-07T10:19:10"...>

and in this example, the timestamp is wrong by two hours (I executed the test at 12:19). The reason seems to be the code in index.js
var timestamp = (new Date()).toISOString().substr(0, 19)

which seems to ignore the timezome. This article describes that the time zone is ignored by default in JavaScript: http://stackoverflow.com/questions/10830357/javascript-toisostring-ignores-timezone-offset

It is not really a terrible bug, but I like to have a timestamp which is correct, because this timestamp is then propagated to the HTML report and when looking at the report, I am interested whether it is an old report or a recent one.

This might work very well on my machine (where I know that the difference is always two hours), but as soon as there is some continuous integration environment and I don't know where in the world this environment is running, I am no longer sure whether the generated report is recent or not.

Possible fixes are described in the stackoverflow article.
Is this something that you can fix?

Thanks & Cheers
Michael

@kieronlanning
Copy link

This is breaking our build server at the moment.

We can't upload the test results because the build system thinks the test results timestamp is invalid. We've got a script which effectively takes the timestamp and fixes it, but this is less than ideal.

@hicom150
Copy link
Collaborator

The problem is that the JUnit XML Schema we are validating against is expecting ISO8601 without timezone 😓 as we can see here https://github.com/karma-runner/karma-junit-reporter/blob/master/junit-schema.xsd#L15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants