Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-2810

Provide JaCoCo agent servlet to expose code coverage data to HTTP clients during Sling Junit Test execution

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • JUnit Core 1.0.8
    • JUnit Core 1.0.10
    • Testing
    • None

    Description

      create a simple REST endpoint for the jacoco agent at /system/sling/jacoco.exec to expose:

      jacoco Agent Status
      -------------------------------------------------------------------------------------------
      HEAD /system/sling/jacoco.exec
      Content-Type: application/octet-stream
      200: jacoco agent is attached and exposed through JMX
      404: jacoco agent not found

      return IAgent.getExecutionData(false)
      -------------------------------------------------------------------------------------------
      GET /system/sling/jacoco.exec
      Content-Type: application/octet-stream
      200: execution data returned as response entity
      404: jacoco agent not found

      Reset execution data and return jacoco.exec file
      ----------------------------------------------------------------------
      POST /system/sling/jacoco.exec [optional param ":sessionId" to set a specific sessionId after reset]
      Content-Type: application/octet-stream
      200: agent was reset (with new sessionId if specified) and prior execution data returned as response entity
      404: jacoco agent not found

      Jacoco instrumentation for OSGi is rather limited in the sense that there is one agent per JVM, and resetting the execution data resets it across the board, which means that concurrent requests to this service on a shared integration test server will need to be restricted during test execution to avoid corrupting coverage data.

      Attachments

        Issue Links

          Activity

            People

              bdelacretaz Bertrand Delacretaz
              madamcin Mark Adamcin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: