Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37277

Provide a way to add CPS-transformed code in a plugin to code coverage

    • Icon: Task Task
    • Resolution: Won't Do
    • Icon: Minor Minor
    • workflow-cps-plugin
    • None

      It'd be handy to be able to add CPS-transformed code from a plugin (i.e., JENKINS-37011 or a GlobalVariable) to code coverage.

          [JENKINS-37277] Provide a way to add CPS-transformed code in a plugin to code coverage

          Andrew Bayer created issue -
          Andrew Bayer made changes -
          Link New: This issue relates to JENKINS-37011 [ JENKINS-37011 ]
          Andrew Bayer made changes -
          Epic Link New: JENKINS-35396 [ 171189 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Issue Type Original: Bug [ 1 ] New: Task [ 3 ]
          Jesse Glick made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: pipeline [ 21692 ]

          Jesse Glick added a comment -

          I do not see any practical way to do this. Code coverage tools typically instrument bytecode. The bytecode generated by the CPS transformer is not going to make any sense to such a tool. So you would have to write a custom extension to the CPS transformer that inserts instrumentation calls directly to a particular code coverage tool, like JaCoCo.

          Seems like it is not worth the marginal gains. Better to write as much as you can in Java.

          Jesse Glick added a comment - I do not see any practical way to do this. Code coverage tools typically instrument bytecode. The bytecode generated by the CPS transformer is not going to make any sense to such a tool. So you would have to write a custom extension to the CPS transformer that inserts instrumentation calls directly to a particular code coverage tool, like JaCoCo. Seems like it is not worth the marginal gains. Better to write as much as you can in Java.

          Jesse Glick added a comment -

          I think this approach has been abandoned.

          Jesse Glick added a comment - I think this approach has been abandoned.
          Jesse Glick made changes -
          Resolution New: Won't Do [ 10001 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            kohsuke Kohsuke Kawaguchi
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: