@@ -62,79 +62,101 @@ module.exports = function (grunt) {
62
62
'--server.port=5610' ,
63
63
] ;
64
64
65
+ const NODE = 'node' ;
66
+ const scriptWithGithubChecks = ( { title, options, cmd, args } ) => (
67
+ process . env . CHECKS_REPORTER_ACTIVE === 'true' ? {
68
+ options,
69
+ cmd : 'yarn' ,
70
+ args : [ 'run' , 'github-checks-reporter' , title , cmd , ...args ] ,
71
+ } : { options, cmd, args } ) ;
72
+ const gruntTaskWithGithubChecks = ( title , task ) =>
73
+ scriptWithGithubChecks ( {
74
+ title,
75
+ cmd : 'yarn' ,
76
+ args : [ 'run' , 'grunt' , task ]
77
+ } ) ;
78
+
65
79
return {
66
80
// used by the test and jenkins:unit tasks
67
81
// runs the eslint script to check for linting errors
68
- eslint : {
69
- cmd : process . execPath ,
82
+ eslint : scriptWithGithubChecks ( {
83
+ title : 'eslint' ,
84
+ cmd : NODE ,
70
85
args : [
71
- require . resolve ( '../../ scripts/eslint') ,
86
+ ' scripts/eslint',
72
87
'--no-cache'
73
88
]
74
- } ,
89
+ } ) ,
75
90
76
- sasslint : {
77
- cmd : process . execPath ,
91
+ sasslint : scriptWithGithubChecks ( {
92
+ title : 'sasslint' ,
93
+ cmd : NODE ,
78
94
args : [
79
- require . resolve ( '../../ scripts/sasslint')
95
+ ' scripts/sasslint'
80
96
]
81
- } ,
97
+ } ) ,
82
98
83
99
// used by the test tasks
84
100
// runs the check_file_casing script to ensure filenames use correct casing
85
- checkFileCasing : {
86
- cmd : process . execPath ,
101
+ checkFileCasing : scriptWithGithubChecks ( {
102
+ title : 'Check file casing' ,
103
+ cmd : NODE ,
87
104
args : [
88
- require . resolve ( '../../ scripts/check_file_casing') ,
105
+ ' scripts/check_file_casing',
89
106
'--quiet' // only log errors, not warnings
90
107
]
91
- } ,
108
+ } ) ,
92
109
93
110
// used by the test tasks
94
111
// runs the check_core_api_changes script to ensure API changes are explictily accepted
95
- checkCoreApiChanges : {
96
- cmd : process . execPath ,
112
+ checkCoreApiChanges : scriptWithGithubChecks ( {
113
+ title : 'Check core API changes' ,
114
+ cmd : NODE ,
97
115
args : [
98
- require . resolve ( '../../ scripts/check_core_api_changes')
116
+ ' scripts/check_core_api_changes'
99
117
]
100
- } ,
118
+ } ) ,
101
119
102
120
// used by the test and jenkins:unit tasks
103
121
// runs the typecheck script to check for Typescript type errors
104
- typeCheck : {
105
- cmd : process . execPath ,
122
+ typeCheck : scriptWithGithubChecks ( {
123
+ title : 'Type check' ,
124
+ cmd : NODE ,
106
125
args : [
107
- require . resolve ( '../../ scripts/type_check')
126
+ ' scripts/type_check'
108
127
]
109
- } ,
128
+ } ) ,
110
129
111
130
// used by the test and jenkins:unit tasks
112
131
// ensures that all typescript files belong to a typescript project
113
- checkTsProjects : {
114
- cmd : process . execPath ,
132
+ checkTsProjects : scriptWithGithubChecks ( {
133
+ title : 'TypeScript - all files belong to a TypeScript project' ,
134
+ cmd : NODE ,
115
135
args : [
116
- require . resolve ( '../../ scripts/check_ts_projects')
136
+ ' scripts/check_ts_projects'
117
137
]
118
- } ,
138
+ } ) ,
119
139
120
140
// used by the test and jenkins:unit tasks
121
141
// runs the i18n_check script to check i18n engine usage
122
- i18nCheck : {
123
- cmd : process . execPath ,
142
+ i18nCheck : scriptWithGithubChecks ( {
143
+ title : 'Internationalization check' ,
144
+ cmd : NODE ,
124
145
args : [
125
- require . resolve ( '../../ scripts/i18n_check') ,
146
+ ' scripts/i18n_check',
126
147
'--ignore-missing' ,
127
148
]
128
- } ,
149
+ } ) ,
129
150
130
151
// used by the test:server task
131
152
// runs all node.js/server mocha tests
132
- mocha : {
133
- cmd : process . execPath ,
153
+ mocha : scriptWithGithubChecks ( {
154
+ title : 'Mocha tests' ,
155
+ cmd : NODE ,
134
156
args : [
135
- require . resolve ( '../../ scripts/mocha')
157
+ ' scripts/mocha'
136
158
]
137
- } ,
159
+ } ) ,
138
160
139
161
// used by the test:browser task
140
162
// runs the kibana server to serve the browser test bundle
@@ -175,29 +197,32 @@ module.exports = function (grunt) {
175
197
]
176
198
} ) ,
177
199
178
- verifyNotice : {
200
+ verifyNotice : scriptWithGithubChecks ( {
201
+ title : 'Verify NOTICE.txt' ,
179
202
options : {
180
203
wait : true ,
181
204
} ,
182
- cmd : process . execPath ,
205
+ cmd : NODE ,
183
206
args : [
184
207
'scripts/notice' ,
185
208
'--validate'
186
209
]
187
- } ,
210
+ } ) ,
188
211
189
- apiIntegrationTests : {
190
- cmd : process . execPath ,
212
+ apiIntegrationTests : scriptWithGithubChecks ( {
213
+ title : 'API integration tests' ,
214
+ cmd : NODE ,
191
215
args : [
192
216
'scripts/functional_tests' ,
193
217
'--config' , 'test/api_integration/config.js' ,
194
218
'--bail' ,
195
219
'--debug' ,
196
220
] ,
197
- } ,
221
+ } ) ,
198
222
199
- serverIntegrationTests : {
200
- cmd : process . execPath ,
223
+ serverIntegrationTests : scriptWithGithubChecks ( {
224
+ title : 'Server integration tests' ,
225
+ cmd : NODE ,
201
226
args : [
202
227
'scripts/functional_tests' ,
203
228
'--config' , 'test/server_integration/http/ssl/config.js' ,
@@ -206,39 +231,54 @@ module.exports = function (grunt) {
206
231
'--debug' ,
207
232
'--kibana-install-dir' , KIBANA_INSTALL_DIR ,
208
233
] ,
209
- } ,
234
+ } ) ,
210
235
211
- interpreterFunctionalTestsRelease : {
212
- cmd : process . execPath ,
236
+ interpreterFunctionalTestsRelease : scriptWithGithubChecks ( {
237
+ title : 'Interpreter functional tests' ,
238
+ cmd : NODE ,
213
239
args : [
214
240
'scripts/functional_tests' ,
215
241
'--config' , 'test/interpreter_functional/config.js' ,
216
242
'--bail' ,
217
243
'--debug' ,
218
244
'--kibana-install-dir' , KIBANA_INSTALL_DIR ,
219
245
] ,
220
- } ,
246
+ } ) ,
221
247
222
- pluginFunctionalTestsRelease : {
223
- cmd : process . execPath ,
248
+ pluginFunctionalTestsRelease : scriptWithGithubChecks ( {
249
+ title : 'Plugin functional tests' ,
250
+ cmd : NODE ,
224
251
args : [
225
252
'scripts/functional_tests' ,
226
253
'--config' , 'test/plugin_functional/config.js' ,
227
254
'--bail' ,
228
255
'--debug' ,
229
256
'--kibana-install-dir' , KIBANA_INSTALL_DIR ,
230
257
] ,
231
- } ,
258
+ } ) ,
232
259
233
- functionalTests : {
234
- cmd : process . execPath ,
260
+ functionalTests : scriptWithGithubChecks ( {
261
+ title : 'Functional tests' ,
262
+ cmd : NODE ,
235
263
args : [
236
264
'scripts/functional_tests' ,
237
265
'--config' , 'test/functional/config.js' ,
238
266
'--bail' ,
239
267
'--debug' ,
240
268
] ,
241
- } ,
269
+ } ) ,
270
+
271
+ licenses : gruntTaskWithGithubChecks ( 'Licenses' , 'licenses' ) ,
272
+ verifyDependencyVersions :
273
+ gruntTaskWithGithubChecks ( 'Verify dependency versions' , 'verifyDependencyVersions' ) ,
274
+ test_server :
275
+ gruntTaskWithGithubChecks ( 'Server tests' , 'test:server' ) ,
276
+ test_jest : gruntTaskWithGithubChecks ( 'Jest tests' , 'test:jest' ) ,
277
+ test_jest_integration :
278
+ gruntTaskWithGithubChecks ( 'Jest integration tests' , 'test:jest_integration' ) ,
279
+ test_projects : gruntTaskWithGithubChecks ( 'Project tests' , 'test:projects' ) ,
280
+ test_browser_ci :
281
+ gruntTaskWithGithubChecks ( 'Browser tests' , 'test:browser-ci' ) ,
242
282
243
283
...getFunctionalTestGroupRunConfigs ( {
244
284
kibanaInstallDir : KIBANA_INSTALL_DIR
0 commit comments