Skip to content
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

Use MC FUS library in AppCenterDistribute tasks #13204

Closed
wants to merge 106 commits into from
Closed
Show file tree
Hide file tree
Changes from 97 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
bc3d646
Initial version of the changes
Jun 22, 2020
a77d8bd
Fix build warnings
Jun 22, 2020
9241995
add mc-fus lib to AppCenterDistributeV2 task
Jun 22, 2020
07f7aa9
Fix parsing
Jun 22, 2020
85f132a
fix mc-fus lib and update implementation in appcenterdistribute file …
Jun 23, 2020
145f120
fix upload id
Jun 23, 2020
8e2d6f8
Cleanup
Jun 23, 2020
496d362
Add mocks
Jun 23, 2020
b7e96d4
Initial changes for V1
vvechkanov Jun 23, 2020
5b7067a
Mock working with file
Jun 23, 2020
6f23534
Fix golden path test
Jun 23, 2020
079db2c
fix downloading release url
Jun 24, 2020
7009c9f
MultipleIpaFail test fix
Jamminroot Jun 24, 2020
721f9a8
Fix NoSymbolsConditionallyPass test wip
Jamminroot Jun 24, 2020
8ea1881
L0NoSymbolsConditionallyPass
Jun 24, 2020
381074d
Add negative test
Jun 24, 2020
0e49579
Fix L0SymDistributeBreakpadWithProguard test
Jamminroot Jun 24, 2020
e1df509
Fix L0SymDistributeBreakpad test
Jamminroot Jun 24, 2020
615aaf6
Update store test
Jun 24, 2020
c97ee67
Fix next store test
Jun 24, 2020
c506e47
FIx publishRelease
vvechkanov Jun 23, 2020
f774dc8
Address feedback
Jun 25, 2020
c25a8fb
Clean logs
vvechkanov Jun 25, 2020
86f3ca4
Fix more tests
Jun 25, 2020
9f54d65
Change any, to class names
vvechkanov Jun 25, 2020
b416740
Fix L0BuildVersionSpecifiedInBodyLeadToSuccessfulUpload test
Jamminroot Jun 25, 2020
46b337f
Fix L0EmptyBuildVersionDoesntAppearInBody test
Jamminroot Jun 25, 2020
f570b5e
Try fixing abort
Jun 25, 2020
941bc15
Merge branch 'feature-mc-fus-v3-unit' of https://github.com/annakoche…
Jun 25, 2020
ba212c9
update mc-fus types
Jun 25, 2020
5b9e3c6
resolve feedback
Jun 25, 2020
caff4f1
Fix remaining tests
Jun 25, 2020
64b16ff
resolve feedback
Jun 26, 2020
047739f
fix tests for ac distribute v2
Jun 25, 2020
0164808
add mock for getting file size
Jun 26, 2020
e4cf7ec
Fix L0OneIpaPass test
Jamminroot Jun 26, 2020
da4d7d4
Fix L0SymIncludeParent test
Jamminroot Jun 26, 2020
fcb004e
Fix L0NoSymbolsConditionallyPass test
Jamminroot Jun 26, 2020
820e530
Fix api and header
Jun 26, 2020
4282eea
Fix L0PublishCommitInfo_X tests (4)
Jamminroot Jun 26, 2020
817c8ec
Fix L0PublishMandatoryUpdate test
Jamminroot Jun 26, 2020
90640a9
Fix L0SymMultipleDSYMs_* tests (4)
Jamminroot Jun 26, 2020
6b801c1
Fix L0SymPDBs_* tests (2)
Jamminroot Jun 26, 2020
a6eb69b
Fix L0ApiRejectsFail test
Jamminroot Jun 26, 2020
b57fa1e
Separate mocks
Jun 26, 2020
3cc5c74
Cleanup tests
Jun 26, 2020
4e0e856
Update Promise to throw properly
Jun 26, 2020
a85e3e2
Merge branch 'feature-mc-fus-v3' into feature-mc-fus-v3-unit
Jun 26, 2020
ee7d219
Revert trash changes
Jun 26, 2020
610705f
Fix api and update promise to throw properly
Jun 29, 2020
cca5946
Merge branch 'feature/update-appcenter-distribute-v2' into feature/up…
Jun 29, 2020
c4f37aa
Remove debug logging
Jamminroot Jun 29, 2020
cf63f1d
fix type
Jun 29, 2020
e2717ad
fix type
Jun 29, 2020
647f624
Apply some feedback from v3
Jun 29, 2020
3a80669
revert extra changes in .json files
Jun 29, 2020
0abf381
formatting
Jun 29, 2020
0556c32
Apply fixes from v3
Jun 29, 2020
afbd8f4
Add const for timeout
Jun 29, 2020
d34d8b6
Merge pull request #1 from annakocheshkova/feature-mc-fus-v3
Jun 29, 2020
56ff399
Merge pull request #6 from annakocheshkova/feature-mc-fus-v3-unit
Jun 29, 2020
0cffe2c
Merge pull request #2 from annakocheshkova/feature/update-appcenter-d…
Jun 29, 2020
93a7892
Merge pull request #3 from annakocheshkova/v-vlvech/mc-fus-v1
Jun 29, 2020
d7c6f68
Merge pull request #5 from annakocheshkova/v-dmchic/mc-fus-v1-tests
Jun 29, 2020
10de74d
Merge pull request #4 from annakocheshkova/feature/update-tests-ac-di…
Jun 29, 2020
f356536
reset package-lock.json
Jun 29, 2020
52c5a4d
fix retrying when http status not 2xx and fix the uploadRelease task …
Jun 29, 2020
9d967fe
add missing changes in tests
Jun 29, 2020
83bb337
Merge pull request #7 from annakocheshkova/feature/fix-missing-points
Jun 30, 2020
89c10c2
Fix timeout exception in tests
Jun 30, 2020
a57948d
move timeout value to const
Jun 30, 2020
9c45511
Merge pull request #8 from annakocheshkova/fix/timeouts-in-tests
Jun 30, 2020
73043de
Mock fs methods.
Jun 30, 2020
7fe4b7f
Merge pull request #9 from annakocheshkova/fix/mock-files
Jun 30, 2020
39e6e85
Remove logging
Jul 1, 2020
c4f0362
Merge remote-tracking branch 'github.com/master' into feature/mc-fus
Jul 1, 2020
752d05f
Test cleanup
Jul 1, 2020
51976de
More refactoring
Jul 1, 2020
41ebca4
Merge pull request #10 from annakocheshkova/feature/mc-fus-test-cleanup
Jul 1, 2020
6b2e75f
Separate the logic
Jul 2, 2020
3897bbe
Separate more logic, remove unused imports.
Jul 2, 2020
9ba623d
Cleanup V1
Jul 2, 2020
3805f72
Cleanup V3
Jul 2, 2020
65cf61d
Final cleanup and fix query
Jul 2, 2020
e62d329
Fix abort
Jul 2, 2020
81a1511
Fix undefined issue
Jul 2, 2020
d965815
Merge pull request #11 from annakocheshkova/mc-fus-feedback
Jul 2, 2020
e82627f
Merge pull request #12 from annakocheshkova/mc-fus-fixes
Jul 2, 2020
bad5785
Merge branch 'master' into feature/mc-fus
Jul 2, 2020
4134238
Do not extract the parameter
Jul 6, 2020
3820741
Deregister mocks
Jul 6, 2020
6992984
Update versions
Jul 6, 2020
854f0ce
Merge branch 'master' into feature/mc-fus
Jul 6, 2020
5e32146
Remove mc-fus library code and import is from local repository.
vvechkanov Jul 7, 2020
09eb579
Format; add references to appropriate places
Jul 8, 2020
d3d917a
Update lib reference
Jul 8, 2020
5ff4a83
Merge pull request #13 from annakocheshkova/v-vlvech/use-mc-fus-exter…
Jul 10, 2020
da3fce0
Resolve feedback
Jul 10, 2020
d4cb1c0
Remove another dependency
Jul 10, 2020
174b794
Add types for "let"
Jul 10, 2020
37db5a3
Replace vsts-task-lib with azure-pipelines-task-lib
Jul 10, 2020
bd80b17
Merge branch 'master' into feature/mc-fus
Jul 10, 2020
4baa1a2
Resolve anotehr part of feedback
Jul 13, 2020
da01e94
Merge branch 'feature/mc-fus' of https://github.com/annakocheshkova/a…
Jul 13, 2020
c51615d
Merge branch 'master' into feature/mc-fus
Jul 14, 2020
0785e94
Merge branch 'master' into feature/mc-fus
Jul 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 29 additions & 17 deletions Tasks/AppCenterDistributeV1/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as assert from 'assert';
import * as ttm from 'vsts-task-lib/mock-test';

describe('AppCenterDistribute L0 Suite', function () {
const timeout = 6000;

before(() => {
//Enable this for output
//process.env['TASK_TEST_TRACE'] = 1;
Expand All @@ -26,7 +28,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: upload one ipa file', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0OneIpaPass.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -36,7 +38,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Negative path: can not upload multiple files', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0MultipleIpaFail.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -45,8 +47,18 @@ describe('AppCenterDistribute L0 Suite', function () {
assert(tr.failed, 'task should have failed');
});

it('Negative path: failed when HTTP status is not 2xx', function () {
this.timeout(6000);

let tp = path.join(__dirname, 'L0FailsHttpStatusNot2xx.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);

tr.run();
assert(tr.succeeded, 'task should have succeeded');
});

it('Negative path: cannot continue upload without symbols', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0NoSymbolsFails.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -56,7 +68,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Postiive path: can continue upload without symbols if variable VSMobileCenterUpload.ContinueIfSymbolsNotFound is true', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0NoSymbolsConditionallyPass.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -66,7 +78,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Negative path: mobile center api rejects fail the task', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0ApiRejectsFail.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -76,7 +88,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: single file with Include Parent', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymIncludeParent.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -86,7 +98,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: multiple dSYMs in the same folder', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymMultipleDSYMs_flat_1.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -96,7 +108,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: multiple dSYMs in parallel folders', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymMultipleDSYMs_flat_2.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -106,7 +118,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: multiple dSYMs in a tree', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymMultipleDSYMs_tree.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -116,7 +128,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: a single dSYM', function () {
this.timeout(6000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymMultipleDSYMs_single.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -126,7 +138,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: a single PDB', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymPDBs_single.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -137,7 +149,7 @@ describe('AppCenterDistribute L0 Suite', function () {


it('Positive path: multiple PDBs', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0SymPDBs_multiple.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -147,7 +159,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: publish commit info (including commit message)', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0PublishCommitInfo_1.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -157,7 +169,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: publish commit info (excluding commit message)', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0PublishCommitInfo_2.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -167,7 +179,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: publish commit info for feature branch', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0PublishCommitInfo_3.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -177,7 +189,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: publish commit info for tfvc branch', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0PublishCommitInfo_4.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand All @@ -187,7 +199,7 @@ describe('AppCenterDistribute L0 Suite', function () {
});

it('Positive path: publish mandatory update', function () {
this.timeout(4000);
this.timeout(timeout);

let tp = path.join(__dirname, 'L0PublishMandatoryUpdate.js');
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
Expand Down
11 changes: 5 additions & 6 deletions Tasks/AppCenterDistributeV1/Tests/L0ApiRejectsFail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
import ma = require('vsts-task-lib/mock-answer');
import tmrm = require('vsts-task-lib/mock-run');
import path = require('path');
import fs = require('fs');
var Readable = require('stream').Readable

var nock = require('nock');
const nock = require('nock');

let taskPath = path.join(__dirname, '..', 'appcenterdistribute.js');
let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);
const taskPath = path.join(__dirname, '..', 'appcenterdistribute.js');
const tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);

tmr.setInput('serverEndpoint', 'MyTestEndpoint');
tmr.setInput('appSlug', 'testuser/testapp');
Expand All @@ -18,7 +16,8 @@ tmr.setInput('releaseNotesInput', 'my release notes');

//prepare upload
nock('https://example.test')
.post('/v0.1/apps/testuser/testapp/package_uploads')
.post('/v0.1/apps/testuser/testapp/uploads/releases')
.query(true)
.reply(403);

// provide answers for task mock
Expand Down
Loading