-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow specifying external tester groups when uploading to test flight… #80
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
const
overlet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other spots in this file too, will update all of them next time.