tcunit/TcUnit-Runner

Explicit execution of static analysis via the AI

kumaraswamygaviyappa opened this issue · 5 comments

Would it be possible to include RunStaticAnalysis in TcUnit-Runner arguments/options when there are no BuildError

The use case as mentioned in TcUnit/issues/93.

  1. The USB license stick in the server. Test server architecture is as mentioned Example_2_-_Separate_Jenkins_master_Jenkins_agent
  2. Developers pushes the code to server, static analysis will be triggered by Jenkins in the Server.

I tested this in tcunit/ExampleProjects by adding below code and it worked well.

image

If this included in TcUnit-Runner , it will be a All in one Framework :)

This should be in a separate tool, that can be included in your Jenkins pipeline as a separate step after execution of the tests. So you basically create a pipeline, where you have the TcUnit-Runner running, and then (depending on result), the Static Code analysis tool.

I wrote a very basic implementation of a tool like that several years ago that's also MIT open-source, and with a bunch of documentation to it. It's available at:
https://github.com/sagatowski/TcStaticAnalysisLoader

Hi @sagatowski ,
Yes, i used same implementation to learn TwinCat programming/Jenkins and tested RunStaticAnalysis.
My understanding is, when Jenkins pipeline is implemented, visual studio process will be enabled two times.

  1. visual studio process will build the project if no errors RunStaticAnalysis.
  2. visual studio process initiated by TcUnit-Runner which builds the project and runs Tcunit frame work.

Is that possible to merge. Is my understanding correct?

It depends on what your definition of "to merge" is.
If it means to run as a single workflow in Jenkins, then yes.

Have you experimented with pipelines in Jenkins?
https://www.jenkins.io/pipeline/getting-started-pipelines/

I think you could probably put these two programs into a pipeline.

@sagatowski

I could achieve this using pipeline. Thank you for the suggestion.

image

VS is invoked 3 times. In Stages Build,TE1200 and Unit Testing. I used TcStaticAnalysisLoader here.
And again VS is invoked by TcUnit-Runner in stage Report Analysis

I feel this not the efficient way but it's working as i wanted.