Comments (18)
Hi konobi!
You're right, I had trouble setting up this part in tap4j, and also wanted to have more time to replace the regex parser by a more robust one.
I will have a look on it as soon as I find some spare time.
Feel free to ping me here if I take too long, or send pull requests ;)
Thanks!
from tap4j.
Unfortunately I'm not a java guy at all, I'm just using the TAP plugin for jenkins (thanks for that btw).
from tap4j.
Don't mention it. Would you have some spare time to test an alpha version of the plug-in? :-) Always good have somebody else to check the changes in the code.
from tap4j.
Yeah, I should be able to get a spare install up and running to test, just let me know.
from tap4j.
Ping? any progress?
from tap4j.
Hi konobi! I'm currently working on an issue in Jenkins TestLink Plug-in (https://issues.jenkins-ci.org/browse/JENKINS-11894) with due date for this week.
My next development cycle (that starts probably tomorrow) will be on tap4j :)
from tap4j.
Hi konobi!
I found some spare time today after lunch and decided to take a look on this issue :-) Here's a summary of my actions:
- I cloned tap4j repository here from Github and tried to parse the TAP Stream you provided here in the same way the plug-in does
- It raised an error. Damn! heh
- Debugged to see where the error was occurring. It was occurring, obviously, in a YAML processing part of tap4j code.
- Then I copied the YAML content, and pasted in a new file.
- Created a sample project using SnakeYaml (API that tap4j relies for YAML) to parse this YAML content.
- It raised an error. Damn again! But now it was complaining of a ':' (don't know the name of this symbol in English heh). It was occurring here:" message: Command failed:".
- To make sure it was a YAML error, I went to InstantYAML (http://instantyaml.appspot.com/) and pasted the YAML content there. Invalid.
- Removed the ':' from your original TAP Stream, in the YAML section of the first test result.
- Worked like a charm! YAY!
This is from YAML entry in Wikipedia:
"Strings
YAML allows one to avoid quoted strings which can enhance readability and avoid the need for nested escape sequences. However, this leads to a pitfall when inline strings are ambiguous single words (e.g. digits or boolean words) or when the unquoted phrase accidentally contains a YAML construct (e.g., a leading exclamation point or a colon-space after a word: "!Caca de vaca!" or "Caution: lions ahead!"). This is not an issue that anyone using a proper YAML emitter will confront, but can come up in ad hoc scripts or human editing of files. In such a case a better approach is to use block literals ( | or > ) rather than inline string expressions as these have no such ambiguities to resolve."
Could you try quote the invalid String, or use block or literals, please? I don't know in which context you are using Jenkins TAP Plug-in, but if you need any help with this too, I would be glad to help.
Let me know if that helps.
All the best,
Bruno
from tap4j.
So having looked at it more... it turns out that these sections of a TAP stream aren't actually YAML... they're YAMLish http://testanything.org/wiki/index.php/YAMLish
So producers only need to follow these guidelines and not produce full valid YAML. This is the case with the producers that I'm testing with.
from tap4j.
So having looked at it more... it turns out that these sections of a TAP stream aren't actually YAML... they're YAMLish
You're right indeed.
So producers only need to follow these guidelines and not produce full valid YAML
Again, you're right. But a consumer needs to know how to parse the YAMLish generated by you. Let's use Perl here as example (as TAP was created for Perl long ago).
Perl TAP::Parser is a parser for TAP, and it supports YAMLish. I believe the YAML support in TAP::Parser was created based on YAML::Tiny. If you try to parse:
name: John:
YAML::Tiny isn't able to parse it. If you remove the second ':', or if you surround it by ' or ", it will work. It doesn't support the whole YAML specification, but instead of this, it's compliant with an old version I guess. Even though, it's YAML'ish' in a certain way :)
Do you see a solution for this issue in tap4j, without dropping SnakeYAML and standard YAML support? I could write a simple YAML parser, but I would feel like reinventing the wheel.
Do you know a YAML producer (could be in Perl, Python, ...) capable of parsing your YAMLish output?
Cheers, B
from tap4j.
Currently I'm using node-tap which has a module on npm called "yamlish" that provides the support. I'll try and get some time to try the output with things like smolder, etc.
from tap4j.
I will have a look at both, node-tap and yamlish. As well as at other projects by isaacs :D thanks!
from tap4j.
I think I'm having an issue related to this:
while parsing a block mapping; expected , but found Scalar; in 'string', line 1, column 43:
... ssage: "Expected '<table class="email_template_main" cellpadding ...
^
at org.tap4j.parser.Tap13Parser.parseDiagnostics(Tap13Parser.java:494)
at org.tap4j.parser.Tap13Parser.parseLine(Tap13Parser.java:274)
at org.tap4j.parser.Tap13Parser.parse(Tap13Parser.java:199)
... 14 more
Caused by: while parsing a block mapping
in 'string', line 1, column 9:
message: "Expected '<table class ...
^
expected , but found Scalar
in 'string', line 1, column 43:
... ssage: "Expected '<table class="email_template_main" cellpadding ...
Any suggestions? Using TAP plugin with Jenkins (which is awesome!).
from tap4j.
Hi @winrid
Any suggestions? Using TAP plugin with Jenkins (which is awesome!).
Thanks :)
If I recall correctly, the problem with this issue was missing surrounding a string with quotes or double quotes. Could you take a look if your YAMLish contains any entries with missing quotes?
from tap4j.
We're containing the strings using double quotes but there are also double quotes within the strings... I could escape these strings before sending to TAP (would have to patch Testem/Jasmine) but I think it would be a more solid fix if it escaped the quotes while generating the TAP report (if that's how it works).
from tap4j.
I believe both ways would fix your issue, but I'm not aware how Testem/Jasmine work :-( but let me know if there is anything I can do to help you.
from tap4j.
Well, all we're doing is running testem which generates the tap file to be processed. Testem does the actual testing.
You can help me I think... I figured out how to escape the quotes in testem (debugged the library for a while until I found where it's printing the error messages to the TAP file) but now TAP is failing on strings like:
while scanning a double-quoted scalar; found unknown escape character .(46); in 'string', line 1, column 621:
... lidate:{pattern:/^([a-zA-Z0-9-.+ ]){1,20}$/i, messages:{patte ...
^
at org.tap4j.parser.Tap13Parser.parseDiagnostics(Tap13Parser.java:501)
at org.tap4j.parser.Tap13Parser.parseLine(Tap13Parser.java:280)
at org.tap4j.parser.Tap13Parser.parse(Tap13Parser.java:199)
... 14 more
Caused by: while scanning a double-quoted scalar
in 'string', line 1, column 18:
message: "Expected '<div class=''form_inp ...
^
found unknown escape character .(46)
in 'string', line 1, column 621:
... lidate:{pattern:/^([a-zA-Z0-9-.+ ]){1,20}$/i, messages:{patte ...
Is there a library I can use to escape all the characters before parsing?
If you can't answer that... is there a way I can set the TAP plugin to not crash when things like this happen? I think I saw in your code you have the actual parsing done in a try{} statement... If I edit your code (very new to Java) how hard is it to get the compiled result into a Jenkins plugin?
Thanks! I'll consider donating.
from tap4j.
Disregard me bugging you about making the Jenkins plugin - that looks easy.
If I fix this I'll send you my fix.
from tap4j.
You can help me I think... I figured out how to escape the quotes in testem (debugged the library for a while until I found where it's printing the error messages to the TAP file) but now TAP is failing on strings like:
tap4j delegates the YAML parsing to Snake YAML. The following link is a web app that lets you test YAML streams. I think that copy/pasting the YAML parts of your output in there may help you understand what is happening :)
http://instantyaml.appspot.com/
Is there a library I can use to escape all the characters before parsing?
Not that I'm aware of. Maybe some Apache component will have that method, but I have never needed or used it before. Sorry.
If you can't answer that... is there a way I can set the TAP plugin to not crash when things like this happen? I think I saw in your code you have the actual parsing done in a try{} statement... If I edit your code (very new to Java) how hard is it to get the compiled result into a Jenkins plugin?
Hmmm, off the top of my head, I believe there is a checkbox,in the advanced config section, where you can disable YAMLish... I think.
Thanks! I'll consider donating.
Thanks, that's a great way to motivate me to work more hours in the plug-ins.
You can also use http://freedomsponsors.org. Posting offers there allow any developer to work on the issue too ;) not necessarily or only me.
from tap4j.
Related Issues (20)
- Add Travis CI
- Update the code for Java 8
- Add CNAME HOT 1
- Error parsing TAP Stream: Invalid indentation HOT 18
- Subtest result string HOT 6
- JUnit Test Runner doesn't output with Gradle HOT 1
- Junit TapListener method list bug HOT 4
- Fix maven site issues before next release HOT 1
- tap4j 4.4 missing from maven central HOT 6
- regression in subtest parsing between 4.2.1 an 4.3 HOT 7
- Subtests order/format change as of v4.3
- tap4j.org has been hacked HOT 1
- Move from multi-module to single-module project
- Unify changes report files HOT 1
- Fix build on Java > 8 HOT 4
- Fix apache-rat errors
- fix checkstyle errors HOT 3
- Find a home for old JUnit, TestNG, and JMeter integrations
- Update website
- Update to TAP 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tap4j.