Skip to content

Commit 30be48c

Browse files
committed
Merge pull request #52 from ivanz/feature/do-not-run-same-assembly-twice
Feature/do not run same assembly twice
2 parents de0b99c + 5abca6a commit 30be48c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Source/Machine.VSTestAdapter/MspecTestAdapterExecutor.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ public void RunTests(IEnumerable<string> sources, IRunContext runContext, IFrame
2222
{
2323
//Debugger.Launch();
2424

25-
foreach (string currentAsssembly in sources)
25+
frameworkHandle.SendMessage(TestMessageLevel.Informational, Strings.EXECUTOR_STARTING);
26+
27+
Settings settings = GetSettings(runContext);
28+
29+
foreach (string currentAsssembly in sources.Distinct())
2630
{
2731
try
2832
{
2933
frameworkHandle.SendMessage(TestMessageLevel.Informational, String.Format(Strings.EXECUTOR_EXECUTINGIN, currentAsssembly));
3034

31-
Settings settings = GetSettings(runContext);
32-
3335
this.executor.RunAssembly(currentAsssembly, settings, uri, frameworkHandle);
3436
}
3537
catch (Exception ex)
@@ -50,13 +52,13 @@ public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrame
5052

5153
int executedSpecCount = 0;
5254

55+
Settings settings = GetSettings(runContext);
56+
5357
string currentAsssembly = string.Empty;
5458
try
5559
{
56-
Settings settings = GetSettings(runContext);
5760

58-
IEnumerable<IGrouping<string, TestCase>> groupByAssembly = tests.GroupBy(x => x.Source);
59-
foreach (IGrouping<string, TestCase> grouping in groupByAssembly) {
61+
foreach (IGrouping<string, TestCase> grouping in tests.GroupBy(x => x.Source)) {
6062
currentAsssembly = grouping.Key;
6163
frameworkHandle.SendMessage(TestMessageLevel.Informational, string.Format(Strings.EXECUTOR_EXECUTINGIN, currentAsssembly));
6264

@@ -66,7 +68,7 @@ public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrame
6668
executedSpecCount += grouping.Count();
6769
}
6870

69-
frameworkHandle.SendMessage(TestMessageLevel.Informational, String.Format(Strings.EXECUTOR_COMPLETE, executedSpecCount, groupByAssembly.Count()));
71+
frameworkHandle.SendMessage(TestMessageLevel.Informational, String.Format(Strings.EXECUTOR_COMPLETE, executedSpecCount, tests.GroupBy(x => x.Source).Count()));
7072
} catch (Exception ex)
7173
{
7274
frameworkHandle.SendMessage(TestMessageLevel.Error, string.Format(Strings.EXECUTOR_ERROR, currentAsssembly, ex.Message));

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
environment:
2-
nuget_version: '2.0.0-beta4'
2+
nuget_version: '2.0.0-beta5'
33
vsix_version: '2.0.0'
44
assembly_version: '2.0.0'
55

0 commit comments

Comments
 (0)