-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bitrise] Added new build service Bitrise.io (#1227)
Close #574.
- Loading branch information
1 parent
37fbef5
commit ad4a8b4
Showing
3 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
'use strict'; | ||
|
||
const Joi = require('joi'); | ||
const ServiceTester = require('./runner/service-tester'); | ||
|
||
const t = new ServiceTester({ id: 'bitrise', title: 'Bitrise' }); | ||
module.exports = t; | ||
|
||
t.create('deploy status') | ||
.get('/cde737473028420d/master.json?token=GCIdEzacE4GW32jLVrZb7A') | ||
.expectJSONTypes(Joi.object().keys({ | ||
name: 'bitrise', | ||
value: Joi.equal( | ||
'success', | ||
'error', | ||
'unknown' | ||
) | ||
})); | ||
|
||
t.create('deploy status without branch') | ||
.get('/cde737473028420d.json?token=GCIdEzacE4GW32jLVrZb7A') | ||
.expectJSONTypes(Joi.object().keys({ | ||
name: 'bitrise', | ||
value: Joi.equal( | ||
'success', | ||
'error', | ||
'unknown' | ||
) | ||
})); | ||
|
||
t.create('unknown branch') | ||
.get('/cde737473028420d/unknown.json?token=GCIdEzacE4GW32jLVrZb7A') | ||
.expectJSON({ name: 'bitrise', value: 'unknown' }); | ||
|
||
t.create('invalid token') | ||
.get('/cde737473028420d/unknown.json?token=token') | ||
.expectJSON({ name: 'bitrise', value: 'inaccessible' }); | ||
|
||
t.create('invalid App ID') | ||
.get('/invalid/master.json?token=GCIdEzacE4GW32jLVrZb7A') | ||
.expectJSON({ name: 'bitrise', value: 'inaccessible' }); | ||
|
||
t.create('server error') | ||
.get('/AppID/branch.json?token=token') | ||
.intercept(nock => nock('https://www.bitrise.io') | ||
.get('/app/AppID/status.json?token=token&branch=branch') | ||
.reply(500, 'Something went wrong')) | ||
.expectJSON({ name: 'bitrise', value: 'inaccessible' }); | ||
|
||
t.create('connection error') | ||
.get('/AppID/branch.json?token=token') | ||
.networkOff() | ||
.expectJSON({ name: 'bitrise', value: 'inaccessible' }); |