-
Notifications
You must be signed in to change notification settings - Fork 8
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
"# time=..." directive #16
Comments
I would be +1 for this if YAML was being replaced. I think the issues mostly are:
By adding a new directive both consumer and producer would have to be updated anyway, where by the previous two points could be addressed. As much as I really don't like the YAML usage, I don't see the advantage to further complexity. |
Yaml for passing tests is excessively noisy; many test runners don't even bother printing it. While of course you can pipe tap to a consumer that does something clever with it, if we are going to say that tap is a machine-readable format not designed for humans, then streaming json or csv would be much better. If we say that one of the fields in yamlish is going to have some meaning in the specification, then that's a pretty big rubicon to cross. I'm not saying I'm against that, but it is an addition that's much broader in scope. A test runner today could well be using That's why I proposes that we leave yaml as being application specific generic test information, and add |
Report all time info with a '# time=##ms' style, according to TestAnything/Specification#16 proposal. Support function-less throws/doesNotThrow and treat as TODO. Add tap.mochaGlobals() to stub out describe() and it() methods. Add mochatap bin for injecting mocha globals into test env.
I'm a fan of that syntax, and I think it should be allowed anywhere in the stream so a long-running test can denote progress. For example:
This way the consumer can differentiate between a hung test and a long-running test. This would be completely optional and meaning should be left to the producer. Also related, it might be nice to have an expected time (e.g. If this second part belongs in a separate proposal, let me know. I don't want to derail this conversation. |
@isaacs @beatgammit has highlighted my distaste for this completely. I was about to say that quickly more parameters will be requested and each line will quickly become to look like a URL string with 10 get parameters.
Already there is a section for random garbage the producer has, it's the YAML section. |
@jonathanKingston I think that the disconnect is happening here:
Yes, that is a place for "random garbage". That's precisely why this non-random non-garbage does not belong there.
Regarding the concern that directives could end up a grab-bag of query params, I think that's largely mitigated by the fact that every directive has specific semantic meaning, and they cannot be combined. For example, Since this is already perfectly valid TAP 13, I'm going to use it in node-tap 1.x, since we desperately need to start reporting timing values. |
I didn't intend for this to have anything to do with failing a test that takes too long, I just want a way for the producer to let the consumer know how long it expects the test to run. This seems like it's derailing the current conversation, so I propose we drop the whole issue of expected run-time.
That's exactly what I was trying to say. I think that the I do like the consistency of this rather than having it in the YAML, but I do understand @jonathanKingston's fear of tons of meta information on the test line. I think that anything more than the time for the test would make it too difficult to read. I honestly don't care which approach (YAML or |
@isaacs I was addressing the producer owns the meaning of the properties as raised by @beatgammit - this is an issue and yes YAML suffers from this. I'm not convinced by anything dictated by a producer rather than the standard.
There in lies the issue with the whole standard. It's lead by usage which isn't a standard at all. Comments were never designed to have directives within them, much like the craziness of using Namespaced YAML has been suggested many times before for the exact usecase here which is a far better idea than adding yet another place to metadata that won't scale very well. There is also another issue open to add meaning to the YAML document #8 If a separate conversation needs to be opened about a better place for meta date I would be much happier with that. One of the issues I have with this is that it doesn't scale for other meta data tests might need.
I would urge you not just to implement yet further changes to the format until we can hammer out some consensus. #17 |
Sorry for bumping such an old issue. Having the test duration as part of the spec would be helpful because TAP consumers often want to display test durations, but different TAP producers do generate this in a consistent format - directive vs. YAML, differing names, different units of time. |
It'd be nice to have a standard way to pass test duration (ie, the amount of time it took for a test to complete), as well as the total time for the set.
I've been experimenting with this approach:
Of course, it could be put in a yaml diag as well, but since diags are typically not printed for passing tests, that doesn't help in the typical case where you have lots of passing tests, but want to optimize just the slow ones.
The directive would look like
/time=((?:[1-9][0-9]*|0)(?:\.[0-9]+)?)(ms|s)/i
where$1
is the number and$2
is the label (either seconds or ms).I don't expect that this would conflict with
todo
orskip
directives, since todo/skip test points are usually near-immediate anyway.The text was updated successfully, but these errors were encountered: