1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.bedstead.harrier.annotations;
18 
19 import static com.android.bedstead.harrier.annotations.AnnotationPriorityRunPrecedence.PRECEDENCE_NOT_IMPORTANT;
20 
21 import java.lang.annotation.ElementType;
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 import java.lang.annotation.Target;
25 
26 /**
27  * Marks that a test method should not be run as part of multi-user presubmit, as defined by
28  * tests using multi-user annotations that opt them into presubmit, like
29  * {@link RequireRunOnWorkProfile}.
30  *
31  * <p>This annotation should be used on any new tests running in a multi-user module. Only after
32  * the test has been in postsubmit for some time, demonstrating it is fast and reliable, should the
33  * annotation be removed to allow it to run as part of presubmit.
34  *
35  * <p>It can also be used for tests which don't meet the requirements to be part of multi-user
36  * presubmits.
37  */
38 @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.TYPE})
39 @Retention(RetentionPolicy.RUNTIME)
40 public @interface Postsubmit {
reason()41     String reason();
42 
priority()43     int priority() default PRECEDENCE_NOT_IMPORTANT;
44 }
45