Skip to content

Commit 427567c

Browse files
author
Dennis Pan
authored
Merge pull request #11538 from snowpardx/users/v-alkhar/updating-the-release
[AppCenterDistributeV3] Add uwp symbols upload support
2 parents 181ab02 + dd5b788 commit 427567c

File tree

7 files changed

+28
-326
lines changed

7 files changed

+28
-326
lines changed

Tasks/AppCenterDistributeV3/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"loc.input.help.symbolsType": "Include symbol files to receive symbolicated stack traces in App Center Diagnostics.",
1818
"loc.input.label.symbolsPath": "Symbols path",
1919
"loc.input.help.symbolsPath": "Relative path from the repo root to the symbols folder.",
20-
"loc.input.label.pdbPath": "Symbols path (*.pdb)",
21-
"loc.input.help.pdbPath": "Relative path from the repo root to PDB symbols files. Path may contain wildcards.",
20+
"loc.input.label.appxsymPath": "Symbols path (*.appxsym)",
21+
"loc.input.help.appxsymPath": "Relative path from the repo root to APPXSYM symbols file.",
2222
"loc.input.label.dsymPath": "dSYM path",
2323
"loc.input.help.dsymPath": "Relative path from the repo root to dSYM folder. Path may contain wildcards.",
2424
"loc.input.label.mappingTxtPath": "Mapping file",

Tasks/AppCenterDistributeV3/Tests/L0.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,10 @@ describe('AppCenterDistribute L0 Suite', function () {
171171
assert(tr.succeeded, 'task should have succeeded');
172172
});
173173

174-
it('Positive path: a single PDB', function () {
174+
it('Positive path: a single APPXSYM', function () {
175175
this.timeout(4000);
176176

177-
let tp = path.join(__dirname, 'L0SymPDBs_single.js');
178-
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
179-
180-
tr.run();
181-
assert(tr.succeeded, 'task should have succeeded');
182-
});
183-
184-
185-
it('Positive path: multiple PDBs', function () {
186-
this.timeout(4000);
187-
188-
let tp = path.join(__dirname, 'L0SymPDBs_multiple.js');
177+
let tp = path.join(__dirname, 'L0SymAPPXSYMs_single.js');
189178
let tr: ttm.MockTestRunner = new ttm.MockTestRunner(tp);
190179

191180
tr.run();

Tasks/AppCenterDistributeV3/Tests/L0SymPDBs_single.ts renamed to Tasks/AppCenterDistributeV3/Tests/L0SymAPPXSYMs_single.ts

Lines changed: 10 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,11 @@ let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);
1616

1717
tmr.setInput('serverEndpoint', 'MyTestEndpoint');
1818
tmr.setInput('appSlug', 'testuser/testapp');
19-
tmr.setInput('app', '/test/path/to/my.ipa');
19+
tmr.setInput('app', '/test/path/to/my.appxbundle');
2020
tmr.setInput('releaseNotesSelection', 'releaseNotesInput');
2121
tmr.setInput('releaseNotesInput', 'my release notes');
2222
tmr.setInput('symbolsType', 'UWP');
23-
tmr.setInput('pdbPath', 'a/**/*.pdb');
24-
25-
/*
26-
dSyms folder structure:
27-
a
28-
f.txt
29-
b
30-
f.txt
31-
c
32-
d
33-
f.txt
34-
f.txt
35-
x.pdb
36-
*/
23+
tmr.setInput('appxsymPath', 'a/my.appxsym');
3724

3825
//prepare upload
3926
nock('https://example.test')
@@ -94,23 +81,15 @@ nock('https://example.test')
9481
// provide answers for task mock
9582
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
9683
'checkPath' : {
97-
'/test/path/to/my.ipa': true,
98-
'a': true,
99-
'a/f.txt': true,
100-
'a/b': true,
101-
'a/b/f.txt': true,
102-
'a/b/c': true,
103-
'a/b/c/f.txt': true,
104-
'a/b/c/d': true,
105-
'a/b/c/d/f.txt': true,
106-
'a/b/c/x.pdb': true
84+
'/test/path/to/my.appxbundle': true,
85+
'a/my.appxsym': true
10786
},
10887
'findMatch' : {
109-
'a/**/*.pdb': [
110-
'a/b/c/x.pdb'
88+
'a/my.appxsym': [
89+
'a/my.appxsym'
11190
],
112-
'/test/path/to/my.ipa': [
113-
'/test/path/to/my.ipa'
91+
'/test/path/to/my.appxbundle': [
92+
'/test/path/to/my.appxbundle'
11493
]
11594
}
11695
};
@@ -132,53 +111,12 @@ fs.createWriteStream = (s: string) => {
132111
return stream;
133112
};
134113

135-
fs.readdirSync = (folder: string) => {
136-
let files: string[] = [];
137-
138-
if (folder === 'a') {
139-
files = [
140-
'f.txt',
141-
'b'
142-
]
143-
} else if (folder === 'a/b') {
144-
files = [
145-
'f.txt',
146-
'c',
147-
'd'
148-
]
149-
} else if (folder === 'a/b/c') {
150-
files = [
151-
'f.txt',
152-
'd',
153-
'x.pdb'
154-
]
155-
} else if (folder === 'a/b/c/d') {
156-
files = [
157-
'f.txt'
158-
]
159-
}
160-
161-
return files;
162-
};
163-
164114
fs.statSync = (s: string) => {
165115
let stat = new Stats;
166116

167-
stat.isFile = () => {
168-
if (s.endsWith('.txt') || s.endsWith('.pdb')) {
169-
return true;
170-
} else {
171-
return false;
172-
}
173-
}
117+
stat.isFile = () => s.endsWith('.appxsym');
174118

175-
stat.isDirectory = () => {
176-
if (s.endsWith('.txt') || s.endsWith('.pdb')) {
177-
return false;
178-
} else {
179-
return true;
180-
}
181-
}
119+
stat.isDirectory = () => !s.endsWith('.appxsym')
182120

183121
stat.size = 100;
184122

Tasks/AppCenterDistributeV3/Tests/L0SymPDBs_multiple.ts

Lines changed: 0 additions & 202 deletions
This file was deleted.

Tasks/AppCenterDistributeV3/appcenterdistribute.ts

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -421,25 +421,8 @@ function expandSymbolsPaths(symbolsType: string, pattern: string, continueOnErro
421421
}
422422
})
423423
}
424-
} else if (symbolsType === "UWP") {
425-
// User can specifay a symbols path pattern that selects
426-
// multiple PDB paths for UWP application.
427-
let pdbPaths = utils.resolvePaths(pattern, continueOnError, packParentFolder);
428-
429-
// Resolved paths can be null if continueIfSymbolsNotFound is true and the file/folder does not exist.
430-
if (pdbPaths) {
431-
pdbPaths.forEach(pdbFile => {
432-
if (pdbFile) {
433-
let pdbPath = utils.checkAndFixFilePath(pdbFile, continueOnError);
434-
// The path can be null if continueIfSymbolsNotFound is true and the file does not exist.
435-
if (pdbPath) {
436-
symbolsPaths.push(pdbPath);
437-
}
438-
}
439-
})
440-
}
441424
} else {
442-
// For all other application types user can specifay a symbols path pattern
425+
// For all other application types user can specify a symbols path pattern
443426
// that selects only one file or one folder.
444427
let symbolsFile = utils.resolveSinglePath(pattern, continueOnError, packParentFolder);
445428

@@ -496,7 +479,7 @@ async function run() {
496479
symbolVariableName = "mappingTxtPath";
497480
break;
498481
case "UWP":
499-
symbolVariableName = "pdbPath";
482+
symbolVariableName = "appxsymPath";
500483
break;
501484
default:
502485
symbolVariableName = "symbolsPath";

0 commit comments

Comments
 (0)