Open
Description
I'm thinking of revisiting #971, but with a twist.
Reporting test duration when tests run concurrently can be misleading, since slow, synchronous code in one test also slows down another. This is why I've been hesitant of exposing the duration numbers in the TAP reporter.
Oddly though we do show durations in the verbose reporter! This has survived all the way from #30.
I wonder if we should only show durations when --serial
is used. This way the numbers will be more accurate and users will be less tempted to fix one "slow" test while the problem is another. We can then also include it in the TAP output.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
sindresorhus commentedon Jan 29, 2018
👍
[-]Log test duration for serial tests only?[/-][+]Log test duration for serial tests only[/+]oantoro commentedon Feb 9, 2018
Hello @novemberborn I am interested in working on this issue.
My question is, how should we format the output?
is it okay?
novemberborn commentedon Feb 9, 2018
@okyantoro yay!
I don't know — the spec is at http://testanything.org/tap-version-13-specification.html.
This may require a PR to https://www.npmjs.com/package/supertap which we use to format the TAP output.
oantoro commentedon Feb 10, 2018
@novemberborn that spec didn't mention about time duration but I think it is reasonable to put the time duration information in test description.
I think it is okay to add
duration
options insupertap.test()
we will have something like this
but if we concat the test title with test duration inside ava, we don't need to modify the supertab behavior, we also already have
pretty-ms
as dependency to format time duration.oantoro commentedon Feb 10, 2018
It is harder than it seem, directly passing the title and duration together like
The above output will not work at least if we pipe those output with
tap-spec
andtap-summary
.When we try to format those output with
tap-summary
, for example$ cat test.txt | npx tap-summary
the result would be:or maybe we can put the time duration in supertap
comment
option?novemberborn commentedon Feb 10, 2018
It should work with
tap-spec
,tap-summary
etc. Perhaps have a look at what other test runners do, e.g.node-tap
.22 remaining items