1{
2  "definitions": {
3    "name": {
4      "type": "string",
5      "title": "Test Name",
6      "default": "",
7      "examples": [
8        "CtsAppTestCases"
9      ],
10      "pattern": "^(.*)$"
11    },
12    "host": {
13      "type": "boolean",
14      "title": "Whether this is a deviceless test and should run on a host"
15    },
16    "file_patterns": {
17      "type": "array",
18      "title": "A list of regex path strings that should trigger this test"
19    },
20    "options": {
21      "type": "array",
22      "title": "Custom options to pass to Tradefed",
23      "items": {
24        "type": "object",
25        "title": "The Items Schema",
26        "properties": {
27          "include-filter": {
28            "type": "string",
29            "title": "RegEx of the class name that should be included in running",
30            "examples": [
31              "android.app.cts.TaskDescriptionTest"
32            ],
33            "pattern": "^(.*)$"
34          },
35          "exclude-filter": {
36            "type": "string",
37            "title": "RegEx of the class name that should be excluded from running",
38            "examples": [
39              "android.app.cts.TaskDescriptionTest"
40            ],
41            "pattern": "^(.*)$"
42          },
43          "include-annotation": {
44            "type": "string",
45            "title": "Include tests annotated with the following annotation",
46            "examples": [
47              "android.platform.test.annotations.Presubmit"
48            ],
49            "pattern": "^(.*)$"
50          },
51          "exclude-annotation": {
52            "type": "string",
53            "title": "Exclude tests annotated with the following annotation",
54            "examples": [
55              "androidx.test.filters.FlakyTest"
56            ],
57            "pattern": "^(.*)$"
58          }
59        }
60      }
61    }
62  },
63  "$schema": "http://json-schema.org/draft-07/schema#",
64  "type": "object",
65  "title": "The Root Schema",
66  "minItems": 1,
67
68  "properties": {
69    "presubmit": {
70      "type": "array",
71      "title": "Presubmit test configuration",
72      "minItems": 1,
73      "items": {
74        "type": "object",
75        "title": "The Items Schema",
76        "required": [
77          "name"
78        ],
79        "properties": {
80          "name": { "$ref": "#/definitions/name" },
81          "options": { "$ref": "#/definitions/options" },
82          "host": { "$ref": "#/definitions/host" },
83          "file_patterns": { "$ref": "#/definitions/file_patterns" }
84        }
85      }
86    },
87    "postsubmit": {
88      "type": "array",
89      "title": "Postsubmit test configuration",
90      "minItems": 1,
91      "items": {
92        "type": "object",
93        "title": "The Items Schema",
94        "required": [
95          "name"
96        ],
97        "properties": {
98          "name": { "$ref": "#/definitions/name" },
99          "options": { "$ref": "#/definitions/options" },
100          "host": { "$ref": "#/definitions/host" }
101        }
102      }
103    },
104    "import": {
105      "type": "array",
106      "title": "Allows you to include tests in other TEST_MAPPING files without copying the content",
107      "items": {
108        "type": "object",
109        "properties": {
110          "path": {
111            "type": "string",
112            "title": "Path from which TEST_MAPPING files should be used. TEST_MAPPING files in the parent directories of the imported path will be included when running tests.",
113            "examples": [
114              "frameworks/base/services/core/java/com/android/server/am"
115            ],
116            "pattern": "^(.*)$"
117          }
118        }
119      }
120    }
121  }
122}