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

Always look for adapters in Test Source directory #1574

Merged
merged 6 commits into from
May 7, 2018
Merged

Always look for adapters in Test Source directory #1574

merged 6 commits into from
May 7, 2018

Conversation

mayankbansal018
Copy link
Contributor

@mayankbansal018 mayankbansal018 commented May 3, 2018

Description

  • Allow Testadapters to be picked from source dir for fullCLR projects
  • Allow dotnet CLI to take multiple inputs for logger, & TAP

Dotnet CLI PR: dotnet/cli#9198

Related issue

Fixes #1319

this.testHostManager.Initialize(this.mockMessageLogger.Object, $"<?xml version=\"1.0\" encoding=\"utf-8\"?><RunSettings> <RunConfiguration><TestAdaptersPaths>C:\\Foo</TestAdaptersPaths></RunConfiguration> </RunSettings>");
List<string> currentList = new List<string> { @"FooExtension.dll" };
List<string> currentList = new List<string> { @"FooExtension.dll", @"C:\Source1\ext1.TestAdapter.dll", @"C:\Source1\ext2.TestAdapter.dll" };
Copy link
Contributor

Choose a reason for hiding this comment

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

Change test name.

@@ -192,7 +191,7 @@ public TestHostConnectionInfo GetTestHostConnectionInfo()
/// <inheritdoc/>
public IEnumerable<string> GetTestPlatformExtensions(IEnumerable<string> sources, IEnumerable<string> extensions)
{
if (sources != null && sources.Any() && this.projectOutputExtensionsRequired)
if (sources != null && sources.Any())
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove explicitly testadapterpath from acceptance tests. Example.

foreach (var arg in this.VSTestTestAdapterPath)
{
allArgs.Add("--testAdapterPath:" + ArgumentEscaper.HandleEscapeSequenceInArgForProcessStart(arg));
}
}
else
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove else condition.


if (arg.StartsWith("console", StringComparison.OrdinalIgnoreCase))
{
initializeConsoleLogger = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Rename to isConsoleLoggerEnabled or something close to it?

var allArguments = vstestTask.CreateArgument().ToArray();

Assert.IsNotNull(allArguments.FirstOrDefault(arg => arg.Contains("--testAdapterPath:path1")));
Assert.IsNotNull(allArguments.FirstOrDefault(arg => arg.Contains("--testAdapterPath:path1")));
Copy link
Contributor

Choose a reason for hiding this comment

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

path2.

Copy link
Contributor

@singhsarab singhsarab left a comment

Choose a reason for hiding this comment

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

Please mention the testing done with respect to changes associated with dotnet cli change.
Approving with suggestions.

@@ -54,7 +54,7 @@ public string VSTestTestCaseFilter
get;
set;
}
public string VSTestLogger
public string[] VSTestLogger
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Should we rename these to reflect the change, VSTestLoggers ?

vstestTask.VSTestFramework = "abc";

vstestTask.VSTestLogger = new string[] { "trx;LogFileName=foo bar.trx", "console" };

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: extra line
Also, better for required properties, use new VSTestTask { TestFileFullPath = "abc", VSTestFramework = "xyz"}

@@ -31,7 +31,7 @@ public string VSTestSetting
set;
}

public string VSTestTestAdapterPath
public string[] VSTestTestAdapterPath
Copy link
Contributor

Choose a reason for hiding this comment

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

string[] [](start = 15, length = 8)

nitpick: IEnumerable over string[]

@cltshivash
Copy link
Contributor

public class VSTestTask : Task, ICancelableTask

is this shipping code ?


Refers to: src/Microsoft.TestPlatform.Build/Tasks/VSTestTask.cs:15 in e6db9d0. [](commit_id = e6db9d0, deletion_comment = False)

@mayankbansal018
Copy link
Contributor Author

@dotnet-bot test Windows_NT / Debug Build please

1 similar comment
@mayankbansal018
Copy link
Contributor Author

@dotnet-bot test Windows_NT / Debug Build please

@mayankbansal018 mayankbansal018 merged commit e6b5743 into microsoft:master May 7, 2018
@smadala smadala deleted the pickadaptersfromSourceLocation branch July 26, 2018 02:43
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.

4 participants