-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow specifying external tester groups when uploading to test flight…
…, allow passing fastlane arguments (#80)
- Loading branch information
Showing
9 changed files
with
326 additions
and
3 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
72 changes: 72 additions & 0 deletions
72
Tasks/app-store-release/Tests/L0ProductionFastlaneArguments.ts
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,72 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import ma = require('vsts-task-lib/mock-answer'); | ||
import tmrm = require('vsts-task-lib/mock-run'); | ||
import path = require('path'); | ||
import os = require('os'); | ||
|
||
let taskPath = path.join(__dirname, '..', 'app-store-release.js'); | ||
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
tmr.setInput('authType', 'UserAndPass'); | ||
tmr.setInput('username', 'creds-username'); | ||
tmr.setInput('password', 'creds-password'); | ||
tmr.setInput('appIdentifier', 'com.microsoft.test.appId'); | ||
tmr.setInput('releaseTrack', 'Production'); | ||
tmr.setInput('installFastlane', 'true'); | ||
tmr.setInput('fastlaneToolsVersion', 'LatestVersion'); | ||
tmr.setInput('fastlaneArguments', '-args someadditioanlargs'); | ||
|
||
tmr.setInput('ipaPath', '**/*.ipa'); | ||
|
||
process.env['MOCK_NORMALIZE_SLASHES'] = true; | ||
process.env['HOME'] = '/usr/bin'; | ||
let gemCache: string = '/usr/bin/.gem-cache'; | ||
|
||
//construct a string that is JSON, call JSON.parse(string), send that to ma.TaskLibAnswers | ||
let myAnswers: string = `{ | ||
"which": { | ||
"ruby": "/usr/bin/ruby", | ||
"gem": "/usr/bin/gem", | ||
"fastlane": "/usr/bin/fastlane" | ||
}, | ||
"checkPath" : { | ||
"/usr/bin/ruby": true, | ||
"/usr/bin/gem": true, | ||
"/usr/bin/fastlane": true | ||
}, | ||
"glob": { | ||
"**/*.ipa": [ | ||
"mypackage.ipa" | ||
] | ||
}, | ||
"exec": { | ||
"/usr/bin/gem install fastlane": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"/usr/bin/gem update fastlane -i ${gemCache}": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"fastlane deliver --force -u creds-username -a com.microsoft.test.appId -i mypackage.ipa --skip_metadata true --skip_screenshots true -args someadditioanlargs": { | ||
"code": 0, | ||
"stdout": "consider it delivered!" | ||
} | ||
} | ||
}`; | ||
let json: any = JSON.parse(myAnswers); | ||
// Cast the json blob into a TaskLibAnswers | ||
tmr.setAnswers(<ma.TaskLibAnswers>json); | ||
|
||
// This is how you can mock NPM packages... | ||
os.platform = () => { | ||
return 'darwin'; | ||
}; | ||
tmr.registerMock('os', os); | ||
|
||
tmr.run(); |
89 changes: 89 additions & 0 deletions
89
Tasks/app-store-release/Tests/L0TestFlightDistributeToExternalTestersWithGroups.ts
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,89 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import ma = require('vsts-task-lib/mock-answer'); | ||
import tmrm = require('vsts-task-lib/mock-run'); | ||
import path = require('path'); | ||
import os = require('os'); | ||
import fs = require('fs'); | ||
let stats = require('fs').Stats; | ||
|
||
let taskPath = path.join(__dirname, '..', 'app-store-release.js'); | ||
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
tmr.setInput('authType', 'UserAndPass'); | ||
tmr.setInput('username', 'creds-username'); | ||
tmr.setInput('password', 'creds-password'); | ||
tmr.setInput('releaseTrack', 'TestFlight'); | ||
tmr.setInput('ipaPath', 'mypackage.ipa'); | ||
tmr.setInput('appIdentifier', 'com.microsoft.test.appId'); | ||
tmr.setInput('distributedToExternalTesters', 'true'); | ||
tmr.setInput('releaseNotes', '/usr/build/releasenotes'); | ||
tmr.setInput('externalTestersGroups', 'Group1,Group 2'); | ||
|
||
process.env['MOCK_NORMALIZE_SLASHES'] = true; | ||
process.env['HOME'] = '/usr/bin'; | ||
let gemCache: string = '/usr/bin/.gem-cache'; | ||
|
||
tmr.registerMock('fs', { | ||
statSync: () => { | ||
let stat = new stats; | ||
stat.isFile = () => { | ||
return true; | ||
}; | ||
return stat; | ||
}, | ||
readFileSync: () => { | ||
return Buffer.from('Release notes for beta release.'); | ||
}, | ||
writeFileSync: fs.writeFileSync | ||
}); | ||
|
||
//construct a string that is JSON, call JSON.parse(string), send that to ma.TaskLibAnswers | ||
let myAnswers: string = `{ | ||
"which": { | ||
"ruby": "/usr/bin/ruby", | ||
"gem": "/usr/bin/gem", | ||
"fastlane": "/usr/bin/fastlane", | ||
"pilot": "/usr/bin/pilot" | ||
}, | ||
"checkPath" : { | ||
"/usr/bin/ruby": true, | ||
"/usr/bin/gem": true, | ||
"/usr/bin/fastlane": true, | ||
"/usr/bin/pilot": true | ||
}, | ||
"glob": { | ||
"mypackage.ipa": [ | ||
"mypackage.ipa" | ||
] | ||
}, | ||
"exec": { | ||
"/usr/bin/gem install fastlane": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"/usr/bin/gem update fastlane -i ${gemCache}": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"fastlane pilot upload -u creds-username -i mypackage.ipa --changelog Release notes for beta release. -a com.microsoft.test.appId --distribute_external true --groups Group1,Group 2": { | ||
"code": 0, | ||
"stdout": "consider it uploaded!" | ||
} | ||
} | ||
}`; | ||
let json: any = JSON.parse(myAnswers); | ||
// Cast the json blob into a TaskLibAnswers | ||
tmr.setAnswers(<ma.TaskLibAnswers>json); | ||
|
||
// This is how you can mock NPM packages... | ||
os.platform = () => { | ||
return 'darwin'; | ||
}; | ||
tmr.registerMock('os', os); | ||
|
||
tmr.run(); |
72 changes: 72 additions & 0 deletions
72
Tasks/app-store-release/Tests/L0TestFlightFastlaneArguments.ts
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,72 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import ma = require('vsts-task-lib/mock-answer'); | ||
import tmrm = require('vsts-task-lib/mock-run'); | ||
import path = require('path'); | ||
import os = require('os'); | ||
|
||
let taskPath = path.join(__dirname, '..', 'app-store-release.js'); | ||
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath); | ||
|
||
tmr.setInput('authType', 'UserAndPass'); | ||
tmr.setInput('username', 'creds-username'); | ||
tmr.setInput('password', 'creds-password'); | ||
tmr.setInput('releaseTrack', 'TestFlight'); | ||
tmr.setInput('installFastlane', 'true'); | ||
tmr.setInput('fastlaneToolsVersion', 'LatestVersion'); | ||
tmr.setInput('fastlaneArguments', '-args someadditioanlargs'); | ||
|
||
// let ipaPath: string = tl.getInput('ipaPath', true); | ||
tmr.setInput('ipaPath', '**/*.ipa'); | ||
|
||
process.env['MOCK_NORMALIZE_SLASHES'] = true; | ||
process.env['HOME'] = '/usr/bin'; | ||
let gemCache: string = '/usr/bin/.gem-cache'; | ||
|
||
//construct a string that is JSON, call JSON.parse(string), send that to ma.TaskLibAnswers | ||
let myAnswers: string = `{ | ||
"which": { | ||
"ruby": "/usr/bin/ruby", | ||
"gem": "/usr/bin/gem", | ||
"fastlane": "/usr/bin/fastlane" | ||
}, | ||
"checkPath" : { | ||
"/usr/bin/ruby": true, | ||
"/usr/bin/gem": true, | ||
"/usr/bin/fastlane": true | ||
}, | ||
"glob": { | ||
"**/*.ipa": [ | ||
"mypackage.ipa" | ||
] | ||
}, | ||
"exec": { | ||
"/usr/bin/gem install fastlane": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"/usr/bin/gem update fastlane -i ${gemCache}": { | ||
"code": 0, | ||
"stdout": "1 gem installed" | ||
}, | ||
"fastlane pilot upload -u creds-username -i mypackage.ipa -args someadditioanlargs": { | ||
"code": 0, | ||
"stdout": "consider it uploaded!" | ||
} | ||
} | ||
}`; | ||
let json: any = JSON.parse(myAnswers); | ||
// Cast the json blob into a TaskLibAnswers | ||
tmr.setAnswers(<ma.TaskLibAnswers>json); | ||
|
||
// This is how you can mock NPM packages... | ||
os.platform = () => { | ||
return 'darwin'; | ||
}; | ||
tmr.registerMock('os', os); | ||
|
||
tmr.run(); |
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
Oops, something went wrong.