Skip to content

Improve TAP Output #723

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

Closed
1 of 7 tasks
jamestalmage opened this issue Apr 5, 2016 · 13 comments
Closed
1 of 7 tasks

Improve TAP Output #723

jamestalmage opened this issue Apr 5, 2016 · 13 comments
Labels

Comments

@jamestalmage
Copy link
Contributor

jamestalmage commented Apr 5, 2016

There are lots of open issues regarding TAP output:

Remaining todo's from #340 (comment)

  • Bring our tap output more inline with node-tap. Specifically, the yaml output for our errors. This should make the output from all the tap-mocha-reporters much nicer. For example, our errors currently have expected and actual properties, but the tap reporters prefer found and wanted. Also, we should use stack-utils to attach the at property (file name and line number of failure).
  • Finish up work on tap-emitter and integrate into AVA.

Notes:

We should be using the TAP v14 draft specification.

Note that the spec does not address what properties should be included in the yaml blocks. In that case we should just emulate node-tap (see list item above for examples of properties we need to add).

@xjamundx
Copy link

xjamundx commented Apr 21, 2016

Probably related to this is the fact that ava tests/ --tap | tap-xunit > ava-results.xml produces some invalid XML characters that makes jenkins fail.

<testsuite name="calculator ESC[90mESC[2m›ESC[22mESC[39m actions ESC[90mESC[2m›ESC[22mESC[39m __tests__ ESC[90mESC[2m›ESC[22mESC[39m Actions.fetchOriginAmount ESC[90mESC[2m›ESC[22mESC[39m with no changes a noop function should be returned" tests="1" failures="0" errors="0">

Jenkins output looks like this:

Failed to read test report file /jobvolume/test-test-test/workspace/metrics-ci/ava-results.xml
org.dom4j.DocumentException: Error on line 3 of document file:///jobvolume/test-test-test/workspace/metrics-ci/ava-results.xml : An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and element is "1b". Nested exception: An invalid XML character (Unicode: 0x{2}) was found in the value of attribute "{1}" and element is "1b".

@sotojuan
Copy link
Contributor

@xjamundx Can you post the actual tests that are giving you the strange XML output? I just tried tap-xunit with some simple tests and it worked fine.

@xjamundx
Copy link

xjamundx commented Apr 26, 2016

@sotojuan it needs to be spread across multiple files:

test/test.js
test/test2.js

running this command

./node_modules/.bin/ava test/test*.js  --tap | ./node_modules/.bin/tap-xunit

The issue (from what I can tell is the little arrows)

<?xml version="1.0"?>
<testsuites>
  <testsuite name="test › this is ta thing" tests="1" failures="0" errors="0">
    <testcase name="#1 test › this is ta thing"/>
  </testsuite>
  <testsuite name="test2 › this is ta thing" tests="1" failures="0" errors="0">
    <testcase name="#2 test2 › this is ta thing"/>
  </testsuite>
</testsuites>

The test I'm using is:

var test = require('ava')
test('this is ta thing', t => t.pass())

@sotojuan
Copy link
Contributor

sotojuan commented Apr 26, 2016

Thanks for the feedback. I'll look into it later today.

@sindresorhus would this be something we can fix (the arrows are not valid XML characters) or is that the responsibility of tap reporters?

@sindresorhus
Copy link
Member

That's something the reporter should fix. We can't possible correctly escape our titles for every possible scenario.

@xjamundx
Copy link

Thanks for the tip @sindresorhus

@sindresorhus
Copy link
Member

It seems we also incorrectly include some ansi escape codes in the title ESC[90mESC[2m. We should use strip-ansi on the title in the tap reporter. @sotojuan Wanna do a PR for that?

(The actual issue is still that the reporter doesn't escape the title though)

@xjamundx
Copy link

xjamundx commented Apr 26, 2016

Thanks for following up. I'll get on the tap-xunit folks about fixing it on their end.

@sotojuan
Copy link
Contributor

Opened #792 to help with the ANSI codes. Once it gets merged please test again with the latest master @xjamundx.

@xjamundx
Copy link

xjamundx commented Apr 28, 2016

Can anyone confirm if the todo output is correct? The tap-xunit reporter is listing any ava todos as failures.

Edit: ava seems to be correct, filed an issue here:
aghassemi/tap-xunit#8

@sotojuan
Copy link
Contributor

@xjamundx We fixed the ANSI escape codes—let us know how they are now.

@xjamundx
Copy link

Woohoo!

On Fri, Apr 29, 2016 at 11:07 AM Juan [email protected] wrote:

@xjamundx https://github.com/xjamundx We fixed the ANSI escape
codes—let us know how they are now.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#723 (comment)

@novemberborn
Copy link
Member

This issue isn't directly actionable. I'm starting to update open TAP-related issues with the feature: tap reporter instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants