Custom XML Report (JSLint)

Hi, I'm looking forward to analyze the possibilities of TeamCity; well, in my case against a existing Jenkins setup.

One of my open points is: I would like to analyze the jslint xml report (generated by the maven/ant plugin jslint4java) within the build job in order to use the benefits of thresholds, history and so one. Unfortunately, there is no support for JSLint. However, I'm a developer.. so why not provide a custom plugin by myself? Is there anywhere a good starting point developing such a xml reporting plugin? I had already seen the basic plugin dev stuff, I had found the sample plugin - but this does not contain something report-able. At least, an existing plugin would be helpful.

This have to be a server, no agent plugin. But what interfaces had to be implemented? Where is an example? What is the actual structure of the reporting system (internally)?

Thank you.

7 comments
Comment actions Permalink

Hello,

I'm not jslint or jslint4java expert, but after a quick investigation I found out that jslint4java supports generating xml reports in several formats, which are: jslint, junit, checkstyle.
Currently TeamCity already supports junit and checkstyle xml reports processing in scope of xml-report-plugin
So to avoid you from doing the same work once more I advise you to configure your jslint4java ant and maven builds to generate checkstyle-like reports and use TeamCity bundled xml-report-plugin to import them.

I've created an issue in our issue tracker http://youtrack.jetbrains.net/issue/TW-16496 and it's very like that jslint xml reports support will appear in TeamCity 7.0!

0
Comment actions Permalink

Oh, thank you for your hint to the updated version. I'd actually 1.3.3 with support for xml only (beside plain). For the others: checkstyle since 1.4.7, junit since 1.4.

However, the output and configuration of the (junit) report must be improved (im still exploring it).. but anyway, a big step forward.


edit1: Okay, if someone else is looking for the same thing I'll provide my results.

I'd explored two ways instrumenting jslint4java (the ant-version via maven-ant-run):

  1. Checkstyle - does not work, an empty file was created. Perhaps this feature is too new and buggy? Potential benefit over JUnit: Setup of thresholds.

  2. JUnit - this works... except that the results' meta data are not correct. Each javascript file is "one test case" and failed at least one assertion blocks. The script is not linkable (meaning you can't use "open in ide"), because each javascript file has the absolute path name of the agent's checkout ressource file.


I'm still exploring if there is a proper solution making the results more "practical". Anyway, the results are readable and the thresholds work.


added edit1

0
Comment actions Permalink

Hello,

jslint4java xml report support for xml reports like

<?xml version="1.0" encoding="UTF-8" ?>
<jslint>
  <file name="...">
    <issue char="..." evidence="..." line="..." reason="..." />
    <issue .../>
  </file>
  <file...>

will be present in TeamCity 6.5

0
Comment actions Permalink

Wow, nice! That sounds great, thank you! I guess the next eap coming this month (compared with the other ones/their cycle).

Regards,
Jan

0
Comment actions Permalink

The next EAP is coming very soon!

0
Comment actions Permalink

Yep, that works! :) Very fast, perfect.

Additionally, a more general feature (related to xml reports or inspections overall) would be configurable thresholds. FindBugs had their own threshold configuration, something like this.

0
Comment actions Permalink

Thanks for pointing this out! It's simply a UI issue (not showing thresholds fields). Will be fixed!
You can also use service messages where threshold attributes should work fine.

0

Please sign in to leave a comment.