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

Setting MapNotRunnableToFailed to true by default #610

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Adapter/MSTest.CoreAdapter/MSTestSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public MSTestSettings()
{
this.CaptureDebugTraces = true;
this.MapInconclusiveToFailed = false;
this.MapNotRunnableToFailed = false;
this.MapNotRunnableToFailed = true;
this.EnableBaseClassTestMethodsFromOtherAssemblies = true;
this.ForcedLegacyMode = false;
this.TestSettingsFile = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeErrorShouldReturnTestOut
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeNone()
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeFailed()
{
var resultOutcome = UnitTestOutcomeHelper.ToTestOutcome(UnitTestOutcome.NotRunnable, this.adapterSettings);
Assert.AreEqual(TestOutcome.None, resultOutcome);
Assert.AreEqual(TestOutcome.Failed, resultOutcome);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void MapInconclusiveToFailedIsByDefaultFalseWhenNotSpecified()
}

[TestMethod]
public void MapNotRunnableToFailedIsByDefaultFalseWhenNotSpecified()
public void MapNotRunnableToFailedIsByDefaultTrueWhenNotSpecified()
{
string runSettingxml =
@"<RunSettings>
Expand All @@ -75,7 +75,7 @@ public void MapNotRunnableToFailedIsByDefaultFalseWhenNotSpecified()

MSTestSettings adapterSettings = MSTestSettings.GetSettings(runSettingxml, MSTestSettings.SettingsNameAlias);

Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
}

[TestMethod]
Expand Down Expand Up @@ -887,7 +887,7 @@ public void PopulateSettingsShouldInitializeDefaultAdapterSettingsWhenDiscoveryC
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand All @@ -899,7 +899,7 @@ public void PopulateSettingsShouldInitializeDefaultSettingsWhenRunSettingsIsNull
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand All @@ -912,7 +912,7 @@ public void PopulateSettingsShouldInitializeDefaultSettingsWhenRunSettingsXmlIsE
MSTestSettings adapterSettings = MSTestSettings.CurrentSettings;
Assert.AreEqual(adapterSettings.CaptureDebugTraces, true);
Assert.AreEqual(adapterSettings.MapInconclusiveToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, false);
Assert.AreEqual(adapterSettings.MapNotRunnableToFailed, true);
Assert.AreEqual(adapterSettings.EnableBaseClassTestMethodsFromOtherAssemblies, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,12 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeErrorShouldReturnTestOut
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeNoneWhenNotSpecified()
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeNoneWhenSpecified()
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change the name for this test.
Should start with UnitTestResults* and just specified, does not make sense. Make sure you call out it's set to false.

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar for the test below.

{
string runSettingxml =
@"<RunSettings>
<MSTestV2>
<MapNotRunnableToFailed>false</MapNotRunnableToFailed>
</MSTestV2>
</RunSettings>";

Expand All @@ -306,6 +307,21 @@ public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnT
Assert.AreEqual(TestOutcome.None, resultOutcome);
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeNotRunnableShouldReturnTestOutcomeFailedWhenNotSpecified()
{
string runSettingxml =
@"<RunSettings>
<MSTestV2>
</MSTestV2>
</RunSettings>";

var adapterSettings = MSTestSettings.GetSettings(runSettingxml, MSTestSettings.SettingsNameAlias);

var resultOutcome = UnitTestOutcomeHelper.ToTestOutcome(UnitTestOutcome.NotRunnable, adapterSettings);
Assert.AreEqual(TestOutcome.Failed, resultOutcome);
}

[TestMethod]
public void UniTestHelperToTestOutcomeForUnitTestOutcomeTimeoutShouldReturnTestOutcomeFailed()
{
Expand Down