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

Duration of tests shown via TAP #119

Closed
swaj opened this issue Jul 19, 2014 · 5 comments
Closed

Duration of tests shown via TAP #119

swaj opened this issue Jul 19, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@swaj
Copy link
Contributor

@swaj swaj commented Jul 19, 2014

In TAP version 13, the specification supports attaching arbitrary data points to a test using YAML. Take a look at the "YAML blocks" section in the specification. In our environment, we use TAP exports so that our Jenkins CI server can keep track of test runs. I recently noticed that the Jenkins TAP plugin actually supports a custom YAML field called duration_ms which indicates the duration of a test.

The output looks something like this (sample taken from the Node.js test runner on Jenkins):

1..5
ok 1 - test-http-client.js
  ---
  duration_ms: 6.924
  ...
ok 2 - test-http-client-connaborted.js
  ---
  duration_ms: 4.321
  ...
ok 3 - test-http-client-onerror.js
  ---
  duration_ms: 5.221
  ...
ok 4 - test-http-client-timeout.js
  ---
  duration_ms: 5.421
  ...
ok 5 - test-net-timeout.js
  ---
  duration_ms: 3.18
  ...

So this issue is relatively simple. Would you be willing to modify the TAP reporter to export this special YAML field? I'm happy to do the work and contribute a pull request for the Lab TAP reporter if you'd like me to.

@hueniverse hueniverse added the request label Aug 3, 2014
@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Aug 3, 2014

I'll take a PR. Need to make it configurable via the options.level setting (e.g. -s is 0, -v is 2).

@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 13, 2014

@swaj is this something that you plan to add/work on?

@swaj

This comment has been minimized.

Copy link
Contributor Author

@swaj swaj commented Aug 15, 2014

@wpruel Yeah I can definitely do the work.

@hueniverse I'm not seeing a setting in the latest versions for options.level. Are you saying that you only want the duration attached when --verbose is enabled?

@hueniverse

This comment has been minimized.

Copy link
Member

@hueniverse hueniverse commented Aug 16, 2014

options.level is based on the -s and -v flags.

@geek geek added this to the 4.1.0 milestone Aug 19, 2014
@geek geek self-assigned this Aug 20, 2014
@geek geek closed this Aug 20, 2014
@geek

This comment has been minimized.

Copy link
Member

@geek geek commented Aug 20, 2014

Fixed via: #163

@Marsup Marsup added feature and removed request labels Sep 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.