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

Throwing exception only if it is of type TestPlatformFormatException #332

Merged
merged 3 commits into from
Dec 15, 2017
Merged

Throwing exception only if it is of type TestPlatformFormatException #332

merged 3 commits into from
Dec 15, 2017

Conversation

mayankbansal018
Copy link
Contributor

No description provided.

@mayankbansal018
Copy link
Contributor Author

@dotnet-bot test Windows / Debug Build

throw ex.InnerException;
// In case of UWP .Net Native Tool Chain compilation. Invoking methods via Reflection doesn't work, hence discovery always fails.
// Hence throwing exception only if it is of type TestPlatformFormatException
if (ex.InnerException is TestPlatformFormatException)
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAIK platform throws only testplatformformatexception, but instead of relying entirely on this fact, we can skip exception specifically when it is thrown because of reflection not working. In other cases, lets throw error.
Skipping all exceptions other than testplatformformatexception might skip unexpected exceptions in addition to reflection related exception.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case any other exception is thrown, which is very unlikely, we should continue with discovery rather than not doing at all, because platform went wrong, which is why I'm only throwing error if it platform exception

@mayankbansal018 mayankbansal018 merged commit 84adab2 into microsoft:master Dec 15, 2017
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
singhsarab pushed a commit to singhsarab/testfx that referenced this pull request Apr 8, 2019
* Fix assembly loading in symbol loader. (microsoft#332)

Instead of attempting to load the test assembly, try to query for it. It should
have been already loaded by the test adapter.

In netcoreapp1.1, attempting to load the same executable within itself throws.

* Add error tracing for symbol parse failure.

* Fix platform tests for objectmodel.

* Fix debug type. Copy manifest file and comcomponents to output directory.
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