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

Looked into return code for nuget download and imporved logging #6943

Merged

Conversation

ShreyasRmsft
Copy link
Member

Looked into return code for nuget download and imporved logging


try {
tl.publishTelemetry(area, feature, Object.assign(getDefaultProps(), properties));
} catch (err) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not required as it's already handled in PublishTelemetry call

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if it is not handled this needs to go into that code..


In reply to: 180741561 [](ancestors = 180741561)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to be double sure on our end and not rely on the try catch there in case someone changed it without our notice.

Can remove it if you guys feel its not required. I personally thought its safer to leave it around just for the simple fact that the telemetry implementation may change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this from here

@@ -194,7 +198,12 @@ async function acquireAndCacheVsTestPlatformNuget(testPlatformVersion: string):

tl.debug(`Downloading Test Platform version ${testPlatformVersion} from ${packageSource} to ${downloadPath}.`);
let startTime = perf();
await nugetTool.exec();
const resultCode = await nugetTool.exec();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug the resultCode always

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove nested if blocks and invert the conditions

@cltshivash
Copy link
Contributor

startInstaller();

why not a try catch around this..?


Refers to: Tasks/VsTestPlatformToolInstaller/vstestplatformtoolinstaller.ts:221 in 20e6f9c. [](commit_id = 20e6f9c, deletion_comment = False)

executionStartTime = perf();

tl.setResourcePath(path.join(__dirname, 'task.json'));

console.log(tl.loc('StartingInstaller'));
console.log('==============================================================================');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this move up as the first one..? even before the call to os.platform ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we need to load the resource file before i can shoot any localized messages to the console.

For the diagnostic version of the task we are going to upload i was just simply thinking of adding a tl.debug(i++); before every statement in the script.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requires localization to output this

Copy link
Contributor

@cltshivash cltshivash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ShreyasRmsft
Copy link
Member Author

Had not added try catch around the startInstaller function as none of the other tasks i saw nested the first call in a try catch block. Was just maintaining parity by adding the try catch inside the function. Can add this if needed but i don't think its required.

@ShreyasRmsft ShreyasRmsft merged commit 899457c into master Apr 12, 2018
@ShreyasRmsft ShreyasRmsft deleted the users/ShreyasRMsft/vstestToolInstallerImprovements branch November 28, 2018 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants