Continuous Integration

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Analyzer Results->Checkstyle Format?

Solved!
Go to solution

I've previously built a small extension to Unit Test Framework that can export UTF results in Junit format so Jenkins can set build health/fail builds appropriately and track what changes broke which tests.

 

I'm considering doing the same for VI Analyzer, so a build cannot move forward unless it passes the VI Analyzer style defined for a particular project.

 

Before I do this, two questions:

  1. Does this (or equivalent) functionality already exist somewhere?
  2. Would you use this if I built it?
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 1 of 9
(6,844 Views)

I wouldn't as I wouldn't treat style as a pass/fail situation. I would probably just look to use the HTML report viewer in jenkins when I get to integrating VI Analyzer.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Message 2 of 9
(6,835 Views)

To be clear, my intended use case is not to fail build if any VIA check fails.  Rather, I’d set the health weighting such that a few missed checks won’t fail the build, but would be visible from a Jenkins dashboard (to know when a tech lead needs to check on things).

 

If a large quantity of style checks fail, I would want to fail the build to prevent blatantly bad code from getting in.

 

This assumes I have a sane set of style checks (like checking for cross linking to another repo, no code called Untitled 76.vi, etc), as opposed to trivial cruft.

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 3 of 9
(6,826 Views)

I would be interested, but would prefer the importance level of the check be used for pass/fail criteria.  Something like only important VIA can cause a fail, medium and low would not.

Message 4 of 9
(6,822 Views)

You may want to consider the Checkstyle format rather than JUnit. In Jenkins, this is consumed by the Warnings plugin.

 

If this was developed, our teams would definitely use it.

Message 5 of 9
(6,813 Views)

Much better!  That's closer to what I was looking for.  Thanks for the feedback.

Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 6 of 9
(6,809 Views)

My use case is as follows: I do run VI Analyzer tests before building, but I don't break a build if tests fail. Instead, I email the reports to the user that triggered the build with his commit.

 

As you might or might not remember, I work with Gitlab and its CI features.




DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (The Future of Team-Based LabVIEW Development)


Message 7 of 9
(6,807 Views)

Yeah that warnings plugin looks much more like what I would hope for

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
0 Kudos
Message 8 of 9
(6,773 Views)
Solution
Accepted by topic author MattP

Ok, I have a first pass version working well on my test system.  It produces an XML file that is compatible with Checkstyle syntax, and is consumable by the Jenkins Checkstyle plugin.

 

It is aware of VI Analyzer test rankings and sets the Checkstyle severity accordingly.

 

I'd love to hear your thoughts for improvement on the Github page for this:

https://github.com/LabVIEW-DCAF/VIA-Checkstyle

 

If I hear good results from you folks, I'll post it to Tools Network as well, otherwise I'll leave it here.

 

 

I also plan to integrate this into the DCAF build toolchain:

https://github.com/LabVIEW-DCAF/buildsystem

 

 

(1.0.0.2: package edited with a bug fix - bad XML declaration, reported by @chinghwayu)

(1.0.0.3: package edited with another bug fix - failed to escape all special characters)

(1.0.1.4: package edited with another bug fix - result severities were sometimes misclassified)

Cheers,

Matt Pollock
National Instruments
Message 9 of 9
(6,636 Views)