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

Fix to determine assembly PlatformTarget for AnyCpu assemblies #1210

Merged
merged 13 commits into from
Oct 24, 2017

Conversation

smadala
Copy link
Contributor

@smadala smadala commented Oct 18, 2017

  • Use AssemblyName.GetAssemblyName to determine platform.

@smadala smadala requested review from harshjain2 and codito October 18, 2017 09:53
{
if (EqtTrace.IsVerboseEnabled)
{
EqtTrace.Verbose("AssemblyMetadataProvider:GetArchitecture() Failed get ProcessorArchitecture using AssemblyName API with exception: {0}", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit : AssemblyMetadataProvider.GetArchitecture() :

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

{
EqtTrace.Error("Failed to determine Assembly Architecture: {0}", ex);
EqtTrace.Info("Failed to determine Assembly Architecture with exception: {0}", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

EqtTrace.IsVerboseEnabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@codito codito left a comment

Choose a reason for hiding this comment

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

Few suggestions


if (EqtTrace.IsVerboseEnabled)
{
EqtTrace.Verbose("AssemblyMetadataProvider.GetArchitecture() Failed get ProcessorArchitecture using AssemblyName API with exception: {0}", ex);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: GetArchitecture: xyz

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.TestPlatform.PerformanceTests
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: fix the namespace

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Assert.IsTrue(stopWatch.ElapsedMilliseconds < expectedElapsedTime, string.Format(PerfAssertMessageFormat, expectedElapsedTime, stopWatch.ElapsedMilliseconds));
}

private void TestDonetAssemblyArch(string projectName, string framework, Architecture expectedArch, long expectedElapsedTime)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spelling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


private void LoadAssemblyIntoMemory(string assemblyPath)
{
// Load the file into RAM in ahead to avoid perf number(expectedElapsedTime) dependence on disk read time.
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this hypothesis is true: any file read once as data will not be read again.

@@ -73,6 +73,7 @@ public void InitializeShouldSetEnableCodeCoverageOfCommandLineOption()
}

[TestMethod]
[Ignore("Issue with xml update after change framework to core2.0, ingore to run other tests on CI")]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spelling

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove it before merge. I'd suggest moving the framework to netcoreapp2.0 to be another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are tracking P0 bug here, Harsh is working on fix.

@@ -213,6 +213,7 @@ public void InitializeShouldAddDefaultSettingsIfNotPresent()
}

[TestMethod]
[Ignore("Issue with xml update after change framework to core2.0, ingore to run other tests on CI")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove it before merge.

@smadala
Copy link
Contributor Author

smadala commented Oct 24, 2017

Got approve from @codito offline.

@smadala smadala merged commit bfac13d into microsoft:master Oct 24, 2017
@smadala smadala deleted the arch-anycpu-fix branch May 23, 2018 13:51
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