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

Today even if classInit wasnt called we used to call class cleanup. f… #372

Merged
merged 9 commits into from
Feb 20, 2018

Conversation

acesiddhu
Copy link
Contributor

Today even if classInit wasnt called we used to call class cleanup. fixing that and adding a test to cover the scenario

#355

…ixing that and adding a test to cover the scenario
errorMessage = realException.Message;
}
else
if (this.IsClassInitializeExecuted)
Copy link
Contributor

Choose a reason for hiding this comment

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

IsClassInitializeExecuted [](start = 29, length = 25)

why another check needed inside?

@@ -111,6 +111,18 @@ public void TestClassInfoClassCleanupMethodSetShouldThrowForMultipleClassCleanup
ActionUtility.ActionShouldThrowExceptionOfType(action, typeof(TypeInspectionException));
}

[TestMethod]
Copy link
Member

Choose a reason for hiding this comment

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

This is a negative test case. Can we add a positive test case as well?

/// <summary>
/// Gets a value indicating whether class cleanup has executed.
/// </summary>
public bool IsClassCleanupExecuted { get; private set; }
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required?

return null;
}
catch (Exception exception)
lock (this.testClassExecuteSyncObject)
Copy link
Contributor

Choose a reason for hiding this comment

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

lock can be removed? All clean ups done in single thread. /cc @AbhitejJohn

@@ -306,40 +311,52 @@ public string RunClassCleanup()
return null;
}

lock (this.testClassExecuteSyncObject)
if (this.IsClassInitializeExecuted)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: how about this.ClassCleanupMethod == null || this.IsClassInitializeExecuted == false?

Copy link
Contributor

@smadala smadala left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@acesiddhu acesiddhu merged commit 189f3b1 into microsoft:master Feb 20, 2018
mayankbansal018 added a commit that referenced this pull request Apr 3, 2018
* Fixing Key collision for test run parameters (#328)

* Base commit

* Adding Unit Test

* PR comments

* Adding logs for diagnostics

* Ignoring Test Temporarily

* Removing ignore

# Conflicts:
#	test/UnitTests/MSTest.CoreAdapter.Unit.Tests/Execution/TestExecutionManagerTests.cs

* Fixing the copyright in the nuspec files. (#350)

* Today even if classInit wasnt called we used to call class cleanup. f… (#372)

* Today even if classInit wasnt called we used to call class cleanup. fixing that and adding a test to cover the scenario
# Conflicts:
#	src/Adapter/MSTest.CoreAdapter/Execution/TestClassInfo.cs

* [Symbol archiving]Converting Portable pdb to full (#375)

* COnverting portable pdbs to full for Symbol archiving

* Fixing nuget package path

* Test fix

* Indent fix

* Update Fileversion for adapter and framework dlls (#337)

* File version update

* Moving to 15.6

* PR comments

* More PR comments

* Throwing exception only if it is of type TestPlatformFormatException (#332)

* Throwing exception only if it is of type TestPlatformFormatException

* test

* Fail discovery if any exception thrown in IDiscoveryContext.GetTestCaseFilter

* Fix masking assembly load faolure error message (#382)


# Conflicts:
#	src/Adapter/MSTest.CoreAdapter/Discovery/AssemblyEnumeratorWrapper.cs
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