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

Suggest publish for running on an isolated machine #1726

Merged
merged 3 commits into from
Aug 13, 2018

Conversation

singhsarab
Copy link
Contributor

Description

For test projects targetting net core, give actionable message to the user in case test host file is not found.

Related issue

#1585

@singhsarab singhsarab requested review from smadala and abhishkk August 10, 2018 14:07
Copy link
Contributor

@abhishkk abhishkk left a comment

Choose a reason for hiding this comment

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

approved with suggestions

}

/// <summary>
/// Looks up a localized string similar to Unable to find test host at {0}. Please publish your test project and retry.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: comment should match with resource string

public void GetTestHostProcessStartIfDepsFileAndTestHostNotFoundShouldThrowException()
{
this.mockFileHelper.Setup(fh => fh.Exists("test.deps.json")).Returns(false);
this.mockFileHelper.Setup(ph => ph.Exists("testhost.dll")).Returns(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

UT for testhost dll true and deps false case.

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

// 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");
EqtTrace.Verbose("DotnetTestHostManager: Assume published test project, with test host path = {0}.", testHostPath);

if (!this.fileHelper.Exists(testHostPath))
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like we could simply replace the message above at line 216 with this new resource?

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 caching the error above, and then throwing that.

@singhsarab singhsarab merged commit c7472a4 into microsoft:master Aug 13, 2018
singhsarab added a commit that referenced this pull request Aug 13, 2018
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