JacocoTestRelocationIntegrationTest.groovy

Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix Jacoco to work with build cache

Jacoco code coverage should work well with the build cache out of the

box. Since appending to a coverage file works with parallel test

execution, see https://github.com/jacoco/jacoco/pull/52, we set

`append=true` and delete the coverage data just before the test task

starts to execute.

Note that this is a breaking change: separate tasks now cannot use the

same coverage file, since each of the tasks will delete it.

Issue: #5269

    • -8
    • +0
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 7 more files in changeset.
Convert existing relocation tests to use new one (#3782)

    • -16
    • +8
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 9 more files in changeset.
Revert "Remove another reference of append=false for JaCoCo tests"

This reverts commit e2c02630ceba4c041d06ca77c640d39438a342ac.

+review REVIEW-6522

    • -0
    • +8
    ./JacocoTestRelocationIntegrationTest.groovy
Remove another reference of append=false for JaCoCo tests

+review REVIEW-6522

    • -8
    • +0
    ./JacocoTestRelocationIntegrationTest.groovy
Use separate output directories for all JVM languages

- Introduce an outputDir on SourceDirectorySet

- Default output directory is now `build/classes/<source directory set name>/<source set name>`

- Example: Java compilation goes to build/classes/java/main instead of build/classes/main

- Adapt JDepend, FindBugs, Test and ValidateTaskProperties tasks to handle multiple class directories

- Deprecate setClassesDir/getClassesDir on SourceSetOutput

- Calling setClassesDir restores old behavior (shared output directory)

- Introduce addClassesDir and getClassesDirs on SourceSetOutput

- OSGi plugin needs a single classes directory, so introduce 'osgiClasses' task that syncs all classes to a single directory

Most of the changes to integration tests are find classes in their new location. Helper methods in AbstractIntegrationSpec

can locate class files vs hardcoding a path.

Squashed commit of sg-split-jvm-classes branch for REVIEW-6502

    • -2
    • +2
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 119 more files in changeset.
Do not append to Jacoco output in tests

So that the task is cached/can be up-to-date

+review REVIEW-6420

    • -0
    • +8
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 2 more files in changeset.
Upgrade JaCoCo library to a Java 9-compatible version

    • -3
    • +0
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 5 more files in changeset.
Basic support for enforcing Jacoco metrics

    • -16
    • +5
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 18 more files in changeset.
Allow 2% difference in Jacoco execution data

+review REVIEW-6301

    • -4
    • +4
    ./JacocoTestRelocationIntegrationTest.groovy
Ignore Jacoco tests on Java 9

+review REVIEW-6301

    • -0
    • +3
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 2 more files in changeset.
Use Levenshtein distance to compare the results

This is actually a much more precise measurement.

+review REVIEW-6301

    • -39
    • +11
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 1 more file in changeset.
Hopefully finally fix flaky test here

It appears that execution data can also differ in the length of the header, so we trim it down to size if that happens.

+review REVIEW-6301

    • -11
    • +29
    ./JacocoTestRelocationIntegrationTest.groovy
Fix test

No need to convert to string here.

+review REVIEW-6301

    • -1
    • +1
    ./JacocoTestRelocationIntegrationTest.groovy
More robust comparison for Jacoco execution data

Let's say 0.5% difference is not a big deal, and we got rid of differences generated by timestamps and random IDs.

+review REVIEW-6301

    • -3
    • +28
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 1 more file in changeset.
Ignore even more of the header of Jacoco execution data

Looks like we have some volatile data at the end of the file as well.

+review REVIEW-6301

    • -3
    • +2
    ./JacocoTestRelocationIntegrationTest.groovy
Ignore more of the header of Jacoco execution data

TeamCity agents have longer host names. Dropping the first 256 bytes leaves us with quite a bit of data to compare.

+review REVIEW-6301

    • -4
    • +8
    ./JacocoTestRelocationIntegrationTest.groovy
Better tests for Jacoco, fix execution data path sensitivity

Jacoco doesn't actually care about the name of the execution data files.

+review REVIEW-6301

    • -0
    • +66
    ./JacocoTestRelocationIntegrationTest.groovy
  1. … 4 more files in changeset.