@@ -3,7 +3,6 @@ import {readdirSync, statSync, existsSync, mkdirSync} from 'fs';
3
3
import { openScreenshotsCloudStorage , openFirebaseScreenshotsDatabase } from '../task_helpers' ;
4
4
import * as path from 'path' ;
5
5
import * as admin from 'firebase-admin' ;
6
- const request = require ( 'request' ) ;
7
6
const imageDiff = require ( 'image-diff' ) ;
8
7
9
8
const SCREENSHOT_DIR = './screenshots' ;
@@ -18,7 +17,6 @@ task('screenshots', () => {
18
17
return getScreenFilenames ( database )
19
18
. then ( ( filenames : string [ ] ) => downloadAllGolds ( filenames , database , prNumber ) )
20
19
. then ( ( results : boolean ) => updateResult ( database , prNumber , results ) )
21
- . then ( ( result : boolean ) => updateGithubStatus ( result , prNumber ) )
22
20
. then ( ( ) => setScreenFilenames ( database , prNumber ) )
23
21
. then ( ( ) => uploadScreenshots ( prNumber , 'diff' ) )
24
22
. then ( ( ) => uploadScreenshots ( prNumber , 'test' ) )
@@ -152,39 +150,3 @@ function diffScreenshot(filename: string, database: admin.database.Database,
152
150
return updateFileResult ( database , reportKey , filenameKey , false ) . then ( ( ) => false ) ;
153
151
}
154
152
}
155
-
156
- function decode ( value : string ) : string {
157
- return value . split ( '' ) . reverse ( ) . join ( '' ) ;
158
- }
159
-
160
- function updateGithubStatus ( result : boolean , prNumber : string ) {
161
- let state = result ? 'success' : 'failure' ;
162
- let sha = process . env [ 'TRAVIS_PULL_REQUEST_SHA' ] ;
163
- let token = decode ( process . env [ 'MATERIAL2_GITHUB_STATUS_TOKEN' ] ) ;
164
-
165
- let data = JSON . stringify ( {
166
- "state" : state ,
167
- "target_url" : `http://material2-screenshots.firebaseapp.com/${ prNumber } ` ,
168
- "context" : "screenshot-diff" ,
169
- "description" : `Screenshot test ${ state } `
170
- } ) ;
171
-
172
- let headers = {
173
- 'Authorization' : `token ${ token } ` ,
174
- 'User-Agent' : 'ScreenshotDiff/1.0.0' ,
175
- 'Content-Type' : 'application/json' ,
176
- 'Content-Length' : Buffer . byteLength ( data )
177
- } ;
178
-
179
- return new admin . Promise ( ( resolve , reject ) => {
180
- request ( {
181
- url : `https://api.github.com/repos/angular/material2/statuses/${ sha } ` ,
182
- method : 'POST' ,
183
- form : data ,
184
- headers : headers
185
- } , function ( error : any , response : any , body : any ) {
186
- resolve ( response . statusCode ) ;
187
- console . log ( response . statusCode ) ;
188
- } ) ;
189
- } ) ;
190
- }
0 commit comments