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

[AppCenterDistributeV3] Add uwp symbols upload support #11487

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"loc.input.help.symbolsType": "Include symbol files to receive symbolicated stack traces in App Center Diagnostics.",
"loc.input.label.symbolsPath": "Symbols path",
"loc.input.help.symbolsPath": "Relative path from the repo root to the symbols folder.",
"loc.input.label.pdbPath": "Symbols path (*.pdb)",
"loc.input.help.pdbPath": "Relative path from the repo root to PDB symbols files. Path may contain wildcards.",
"loc.input.label.appxsymPath": "Symbols path (*.appxsym)",
"loc.input.help.appxsymPath": "Relative path from the repo root to APPXSYM symbols file.",
"loc.input.label.dsymPath": "dSYM path",
"loc.input.help.dsymPath": "Relative path from the repo root to dSYM folder. Path may contain wildcards.",
"loc.input.label.mappingTxtPath": "Mapping file",
Expand Down
15 changes: 2 additions & 13 deletions Tasks/AppCenterDistributeV3/Tests/L0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,10 @@ describe('AppCenterDistribute L0 Suite', function () {
assert(tr.succeeded, 'task should have succeeded');
});

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

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

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


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

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

tr.run();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,11 @@ let tmr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);

tmr.setInput('serverEndpoint', 'MyTestEndpoint');
tmr.setInput('appSlug', 'testuser/testapp');
tmr.setInput('app', '/test/path/to/my.ipa');
tmr.setInput('app', '/test/path/to/my.appxbundle');
tmr.setInput('releaseNotesSelection', 'releaseNotesInput');
tmr.setInput('releaseNotesInput', 'my release notes');
tmr.setInput('symbolsType', 'UWP');
tmr.setInput('pdbPath', 'a/**/*.pdb');

/*
dSyms folder structure:
a
f.txt
b
f.txt
c
d
f.txt
f.txt
x.pdb
*/
tmr.setInput('appxsymPath', 'a/my.appxsym');

//prepare upload
nock('https://example.test')
Expand Down Expand Up @@ -94,23 +81,15 @@ nock('https://example.test')
// provide answers for task mock
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
'checkPath' : {
'/test/path/to/my.ipa': true,
'a': true,
'a/f.txt': true,
'a/b': true,
'a/b/f.txt': true,
'a/b/c': true,
'a/b/c/f.txt': true,
'a/b/c/d': true,
'a/b/c/d/f.txt': true,
'a/b/c/x.pdb': true
'/test/path/to/my.appxbundle': true,
'a/my.appxsym': true
},
'findMatch' : {
'a/**/*.pdb': [
'a/b/c/x.pdb'
'a/my.appxsym': [
'a/my.appxsym'
],
'/test/path/to/my.ipa': [
'/test/path/to/my.ipa'
'/test/path/to/my.appxbundle': [
'/test/path/to/my.appxbundle'
]
}
};
Expand All @@ -132,53 +111,12 @@ fs.createWriteStream = (s: string) => {
return stream;
};

fs.readdirSync = (folder: string) => {
let files: string[] = [];

if (folder === 'a') {
files = [
'f.txt',
'b'
]
} else if (folder === 'a/b') {
files = [
'f.txt',
'c',
'd'
]
} else if (folder === 'a/b/c') {
files = [
'f.txt',
'd',
'x.pdb'
]
} else if (folder === 'a/b/c/d') {
files = [
'f.txt'
]
}

return files;
};

fs.statSync = (s: string) => {
let stat = new Stats;

stat.isFile = () => {
if (s.endsWith('.txt') || s.endsWith('.pdb')) {
return true;
} else {
return false;
}
}
stat.isFile = () => s.endsWith('.appxsym');

stat.isDirectory = () => {
if (s.endsWith('.txt') || s.endsWith('.pdb')) {
return false;
} else {
return true;
}
}
stat.isDirectory = () => !s.endsWith('.appxsym')

stat.size = 100;

Expand Down
202 changes: 0 additions & 202 deletions Tasks/AppCenterDistributeV3/Tests/L0SymPDBs_multiple.ts

This file was deleted.

21 changes: 2 additions & 19 deletions Tasks/AppCenterDistributeV3/appcenterdistribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,25 +421,8 @@ function expandSymbolsPaths(symbolsType: string, pattern: string, continueOnErro
}
})
}
} else if (symbolsType === "UWP") {
// User can specifay a symbols path pattern that selects
// multiple PDB paths for UWP application.
let pdbPaths = utils.resolvePaths(pattern, continueOnError, packParentFolder);

// Resolved paths can be null if continueIfSymbolsNotFound is true and the file/folder does not exist.
if (pdbPaths) {
pdbPaths.forEach(pdbFile => {
if (pdbFile) {
let pdbPath = utils.checkAndFixFilePath(pdbFile, continueOnError);
// The path can be null if continueIfSymbolsNotFound is true and the file does not exist.
if (pdbPath) {
symbolsPaths.push(pdbPath);
}
}
})
}
} else {
// For all other application types user can specifay a symbols path pattern
// For all other application types user can specify a symbols path pattern
// that selects only one file or one folder.
let symbolsFile = utils.resolveSinglePath(pattern, continueOnError, packParentFolder);

Expand Down Expand Up @@ -496,7 +479,7 @@ async function run() {
symbolVariableName = "mappingTxtPath";
break;
case "UWP":
symbolVariableName = "pdbPath";
symbolVariableName = "appxsymPath";
break;
default:
symbolVariableName = "symbolsPath";
Expand Down
Loading