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

Resolve testhost from source directory if we couldnt resolve it via nuget cache #690

Merged
merged 2 commits into from
Apr 5, 2017

Conversation

Faizan2304
Copy link
Contributor

Issue: #657

Fix: Try to resolve testhost from source location if you couldn’t resolve it via nuget.

Test: Added UT to cover change and tested the fix manually

Fix: Try to resolve testhost from source location if you couldn’t resolve it via nuget.
@msftclas
Copy link

msftclas commented Apr 4, 2017

@Faizan2304,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

string testHostFullPath = @"C:\packages\microsoft.testplatform.testhost/15.0.0-Dev\lib/netstandard1.5/testhost.dll";
this.mockFileHelper.Setup(ph => ph.Exists(testHostFullPath)).Returns(false);

string testHostPath = Path.Combine($"{Path.DirectorySeparatorChar}tmp", "testhost.dll");
Copy link
Contributor

Choose a reason for hiding this comment

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

string testHostPath = Path.Combine($"{Path.DirectorySeparatorChar}tmp", "testhost.dll"); [](start = 12, length = 88)

Reuse class variable declared above:
Line No : 63 : this.defaultTestHostPath = @"\tmp\testhost.dll";

@harshjain2
Copy link
Contributor

:shipit:

Copy link
Contributor

@harshjain2 harshjain2 left a comment

Choose a reason for hiding this comment

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

👍 with a suggestion.

// Try resolving testhost from output directory of test project. This is required if user has published the test project
// and is running tests in an isolated machine. A second scenario is self test: test platform unit tests take a project
// dependency on testhost (instead of nuget dependency), this drops testhost to output path.
testHostPath = Path.Combine(sourceDirectory, "testhost.dll");
Copy link
Contributor

Choose a reason for hiding this comment

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

We should handle case if testhost.dll does not exist in sourceDirectory too for some reason.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. Would this publish the Extensions folder, that has the default extensions here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AbhitejJohn : very interesting catch 👍 . we are planning to handle thing related to Extension in separate task.

}
}";

MemoryStream runtimeConfigStream = new MemoryStream(Encoding.UTF8.GetBytes(runtimeConfigFileContent));
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use using...

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 cant use using here as these memory stream are getting use in mock

@Faizan2304 Faizan2304 merged commit 080f045 into microsoft:master Apr 5, 2017
@Faizan2304 Faizan2304 deleted the findTesthost branch April 5, 2017 09:59
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.

6 participants