TAP is something that I invested a lot of time years ago, but nowadays I rarely have time to maintain any project, or contribute to the project (which is active on GitHub now https://github.com/testanything , but before we had only a Wiki that would be offline and be restored from some backup a few times :) This is what I ended up being involved with: - Joined the mailing lists, and updated the Wiki. Eventually joine…
Test Anything Protocol
21–30 of 31 posts
Re: Test Anything Protocol
#22Earlier quoted context omitted.
I guess the projects you mentioned are complementary, in that TAP as I understood it merely specs the output stream/protocol that a test run is expected to produce and isn't limited to testing shell scripts, whereas cram/mdx appears more like a user acceptance test convention specifically for shell script code as component-under-test, much in the spirit of "behavioural" testing a la jBehave.
just want to clarify that the program-under-test in cram can be written in anything, as long as it's executable and produces some outputs (stdout, stderr (or any other file descriptor, really), files, exit code). right now i'm using cram to test a program written in F#. it's true that cram shines in tests for programs written in sh/bash/zsh, where you can output the command lines your PUT consists of (while | instead…
Re: Test Anything Protocol
#23I looked at TAP when I had to implement a testing tool for my own language. In the end, I didn't really see the point of using TAP. Is anyone using it outside Perl? What are its specific advantages compared to using common testing libraries?
Same motivation as JUnit, I guess: it's a common protocol that different testing tools can all agree to speak/understand.
Am I missing something? I was actually recently looking into BDD-like tools recently, so I feel like I'm a potential user for TAP, but I just can't grok the value add in it offhand.
edit: oh, maybe TAP is the inverse of what I was thinking. It's about output of test suites, for common post-test tooling? Aka to give statuses about the state of tests?
Re: Test Anything Protocol
#24I can't find anything about why I would want to use it over any of the hundreds of other testing frameworks out there. How does it compare to xUnit? Is it even the same type of thing? Do any of the links lead to non-trivial examples?
Re: Test Anything Protocol
#25TAP is fantastic for testing your Postgres database (indexes, views, functions, triggers, etc.) without depending on any specific client language: https://pgtap.org/
PgTAP looks interesting. Can you mention some use cases and interesting things that it caught? The same author also wrote a port for MySQL: https://github.com/hepabolu/mytap
Here are some pgTAP examples from my work:
pgsodium: https://github.com/michelp/pgsodium/blob/master/test/test.sq...
pgjwt: https://github.com/michelp/pgjwt/blob/master/test.sql
metagration: https://github.com/michelp/metagration/blob/master/test.sql
Re: Test Anything Protocol
#26So TAP is great if you're making an Autotoolized project. Although given that Autoconf's release team has abandoned Autoconf, maybe good Autotools support isn't as important as it used to be.
Re: Test Anything Protocol
#27I can't find anything about why I would want to use it over any of the hundreds of other testing frameworks out there. How does it compare to xUnit? Is it even the same type of thing? Do any of the links lead to non-trivial examples?
TAP is more about the question of "how does a test suite report success/failure to whatever launched it", and all it describes is what the test-suite should report on stdout. It doesn't offer any opinions about language or implementation.
Re: Test Anything Protocol
#28I looked into TAP a while ago, but had a couple of problems with it: 1) The whole point is to allow language/harness agnostic tooling, but the only tool of note seems to be smoulder. Everything else seems to be trivial things like showing pass/fail with emoji tick/cross symbols, etc. 2) The TAP standard allows tests to be numbered, and a total count to be given up-front. In practice, all tools seem to require this, a…
Interesting. In the Node.js ecosystem there are loads of different interfaces (https://github.com/substack/tape/#pretty-reporters), but my favorite is node-tap (which also comes with coverage tests and such).
Re: Test Anything Protocol
#29[1]: https://gist.github.com/johnsonjo4531/d751d7b63576a50878c977...
Re: Test Anything Protocol
#30https://github.com/mpontillo/tap13
TL;DR: it takes TAP output (in the form of a []string, one string per line) and produces a Results struct containing an array of Test structs. The goal was to sufficiently parse the TAP output so that it could be transformed sufficiently for storage in other systems.