-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore code coverage for method executed non-deterministically in tes…
…ts (#838) Fixes #828 (hopefully) There is some non-determinism in whether `com.uber.nullaway.dataflow.AccessPath.IteratorContentsKey#equals` runs or not during tests (see the code comment). The non-determinism will be hard for us to fix, so instead, add an annotation that tells JaCoCo to ignore coverage of this method (which is low risk as it's an `equals()` method that I don't expect will change).
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
nullaway/src/main/java/com/uber/nullaway/annotations/JacocoIgnoreGenerated.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.uber.nullaway.annotations; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Annotation to indicate to Jacoco that code coverage of a method or constructor should be ignored. | ||
* Jacoco requires such annotations to have "Generated" in their name. | ||
*/ | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) | ||
public @interface JacocoIgnoreGenerated {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters