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

Ouput test duration and stack trace in TAP YAML block #1209

Closed
wants to merge 3 commits into from

Conversation

albanf
Copy link

@albanf albanf commented May 7, 2014

@tj
Copy link
Contributor

tj commented May 7, 2014

-1 from me, this is why TAP doesn't really make much sense, it's pretty useless on its own

*/
function writeDiagnostic(test, err){
var obj = {};
if (test.duration) obj.duration_ms = test.duration / 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, so the name suggest it's milliseconds (duration_ms) when in fact it is seconds (/ 1000)?!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what? ms = seconds / 1000

A millisecond (from milli- and second; abbreviation: ms) is a thousandth (10−3 or 1/1,000) of a second.[1] Its symbol is ms. One millisecond is to one second as one second is to 16.67 minutes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, a couple of things went wrong here :) I assumed that test.duration was in milliseconds, since that's the standard unit in javascript.

Also, 1000ms === 1s so to convert from seconds to milliseconds we need to multiply it with 1000, since it takes 1000ms to make up 1s. Heh, converting between time units is always a pain.

The correct code should, I think, be obj.duration_ms = test.duration * 1000.

@albanf
Copy link
Author

albanf commented May 20, 2014

Unit fixed. Goes along with this pull request on the TAP plugin: jenkinsci/tap-plugin#6.

@jbnicolai
Copy link

Sorry, but afraid I agree with TJ. Although I appreciate the effort, I'm closing the PR.

@jbnicolai jbnicolai closed this Jul 14, 2014
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

Successfully merging this pull request may close these issues.

5 participants