-
Notifications
You must be signed in to change notification settings - Fork 76
/
schema.json
216 lines (206 loc) · 6.33 KB
/
schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
{
"id": "http://api.codeclimate.com/test-coverage-schema#",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Test Coverage",
"description": "Schema that describes the format of the test coverage payload sent to Code Climate",
"type": "object",
"properties": {
"covered_percent": {
"description": "Overall coverage percentage as reported by underlying coverage tool if available",
"$ref": "#/definitions/covered_percent"
},
"covered_strength": {
"description": "Hits/Line as reporter by underlying coverage tool if available",
"$ref": "#/definitions/covered_strength"
},
"partial": {
"description": "If the coverage reported only represents some of the total coverage (deprecated)",
"type": "boolean"
},
"repo_token": {
"description": "The per-repository identifier supplied by Code Climate",
"type": "string",
},
"run_at": {
"description": "UNIX timestamp of when coverage was processed",
"$ref": "#/definitions/timestamp",
},
"source_files": {
"description": "Collection of source files containing coverage data",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/definitions/source_file"
},
},
"environment": {
"description": "Information and context related to the environment where tests are run",
"$ref": "#/definitions/environment"
},
"git": {
"description": "Git data about the source code under test",
"$ref": "#/definitions/git"
},
"line_counts": {
"description": "Total line counts if available",
"$ref": "#/definitions/line_counts",
},
"ci_service": {
"description": "Build related data as reported by CI service which ran tests",
"$ref": "#/definitions/ci_service"
}
},
"required": ["source_files", "git", "covered_percent", "covered_strength", "line_counts"],
"definitions": {
"source_file": {
"description": "Meta-data and coverage information for source file under test.",
"type": "object",
"properties": {
"blob_id": {
"description": "Blob SHA as reported by git",
"$ref": "#/definitions/git_sha"
},
"coverage": {
"description": "Actual line by line coverage data, represented as a string for safety. A null represents not coverable, and a 0-n represents the number of times the line is covered.",
"type": "string",
"pattern": "^\\[\\s*((\\d+|null),\\s*)*(\\d+|null),?\\s*\\]$", // https://regex101.com/r/urhEhA/1
},
"name": {
"description": "Path to source file under test",
"type": "string",
"pattern": "^[^/]",
},
"covered_percent": {
"$ref": "#/definitions/covered_percent"
},
"covered_strength": {
"$ref": "#/definitions/covered_strength"
},
"line_counts": {
"$ref": "#/definitions/line_counts"
}
},
"required": ["name", "blob_id", "coverage", "covered_percent", "covered_strength", "line_counts"],
},
"environment": {
"type": "object",
"properties": {
"pwd": {
"description": "Working directory where test reporter is executed from",
"type": "string",
"pattern": "^/"
},
"rails_root": {
"description": "Root of Rails repository as reported by Rails",
"type": "string",
},
"reporter_version": {
"description": "Version of Code Climate test reporter tool as reported by python and javascript clients",
"type": "string",
},
"simplecov_root": {
"description": "Simplecov root as reported by Simplecov",
"type": "string",
},
},
},
"git": {
"type": "object",
"properties": {
"branch": {
"description": "Current git branch",
"type": "string"
},
"committed_at": {
"description": "UNIX timestamp when HEAD committed",
"$ref": "#/definitions/timestamp"
},
"head": {
"description": "Commit sha of HEAD",
"$ref": "#/definitions/git_sha"
}
},
"required": ["branch", "committed_at", "head"],
},
"ci_service": {
"type": "object",
"properties": {
"branch": {
"description": "Branch of code under test",
"type": "string",
},
"build_identifier": {
"description": "Unique id of build",
"type": "string",
},
"build_url": {
"description": "URL to build on CI service",
"type": "string",
},
"commit_sha": {
"description": "Git commit sha checked out for test",
"$ref": "#/definitions/git_sha"
},
"committed_at": {
"description": "UNIX timestamp when HEAD committed",
"$ref": "#/definitions/timestamp"
},
"name": {
"description": "Name of CI service which ran build",
"type": "string",
},
"pull_request": {
"description": "Number of pull request related to build if applicable",
"type": "number"
},
"worker_id": {
"description": "For deprecated version of parallel test support",
"type": "string",
},
},
},
"line_counts": {
"type": "object",
"properties": {
"covered": {
"description": "Number of covered lines of code",
"type": "number",
"minimum": 0,
},
"missed": {
"description": "Number of uncovered lines of code",
"type": "number",
"minimum": 0,
},
"total": {
"description": "Total lines of code",
"type": "number",
"minimum": 0,
},
},
"required": ["covered", "missed", "total"],
},
"git_sha": {
"type": "string",
"pattern": "^[a-zA-Z0-9]{40}$",
},
"timestamp": {
"type": "number",
"minimum": 0,
},
"semantic_version": {
"type": "string",
"pattern": "^\\d{1,}\\.\\d{1,}\\.\\d{1,}",
},
"covered_percent": {
"type": "number",
"minimum": 0,
"maximum": 100,
},
"covered_strength": {
"type": "number",
"minimum": 0,
},
},
}