Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36b2f512 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Remind ourselves why @IgnoreUnderRavenwood.

To aid future auditing, and determining which tests might be
ready to enable, support adding blockedBy and/or reason to
the @IgnoreUnderRavenwood annotation.  Apply to most of our
existing usages in tests.

Bug: 292141694
Test: atest-dev CtsUtilTestCasesRavenwood CtsProtoTestCasesRavenwood CtsOsTestCasesRavenwood CtsContentTestCasesRavenwood CtsDatabaseTestCasesRavenwood
Change-Id: I8807c44013f8f029844de641b43804ecf3766acb
parent 2acaa723
Loading
Loading
Loading
Loading
+20 −2
Original line number Diff line number Diff line
@@ -22,12 +22,30 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * THIS ANNOTATION IS EXPERIMENTAL. REACH OUT TO g/ravenwood BEFORE USING IT, OR YOU HAVE ANY
 * QUESTIONS ABOUT IT.
 * Test methods marked with this annotation are quietly ignored when running under a Ravenwood test
 * environment. The test continues to execute normally under all other non-Ravenwood test
 * environments.
 *
 * This annotation only takes effect when the containing class has a {@code
 * RavenwoodRule} configured. Ignoring is accomplished by throwing an {@code org.junit
 * .AssumptionViolatedException} which test infrastructure treats as being ignored.
 *
 * Developers are encouraged to use either the {@code blockedBy} and/or {@code reason} arguments
 * to document why a test is being ignored, to aid in future audits of tests that are candidates
 * to be enabled.
 *
 * @hide
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface IgnoreUnderRavenwood {
    /**
     * One or more classes that aren't yet supported by Ravenwood, which this test depends on.
     */
    Class<?>[] blockedBy() default {};

    /**
     * General free-form description of why this test is being ignored.
     */
    String reason() default "";
}