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

Adding filtering support at discovery #271

Merged
merged 3 commits into from
Sep 20, 2017

Conversation

abhishekkumawat23
Copy link
Contributor

TPv2 now exposes filtering support at discovery.
Using that support via reflection (As filtering support is not exposed to IDiscoveryContext)

@msftclas
Copy link

@abhishekkumawat23,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

ITestCaseFilterExpression filterExpression = this.TestMethodFilter.GetFilterExpression(discoveryContext, logger, out filterHasError);
if (filterHasError)
{
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

This would not return anything. Is this the spec?
Should we log in that case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I discussed with Pratap. Discovery should not happen in case filter has error

{
try
{
// GetTestCaseFilter is present in DiscoveryContext but not in IDiscoveryContext interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this present in Dev11 as well? Did we validate this scenario in Dev11/Dev12?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Validated in dev 12

public void GetFilterExpressionForDiscoveryContextWithoutGetTestCaseFilterReturnsNullTestCaseFilterExpression()
{
TestableTestExecutionRecorder recorder = new TestableTestExecutionRecorder();
var dummyFilterExpression = new TestableTestCaseFilterExpression();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not required.

}
catch (TargetInvocationException ex)
{
throw ex.InnerException;
Copy link
Contributor

Choose a reason for hiding this comment

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

and who would handle this if it isn't a TestPlatformException or for that matter a non-TargetInvocationException is thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

platform handles it automatically. message is logged in case of exception by platform.

@AbhitejJohn
Copy link
Contributor

Thanks for the clarifications. Approved!
Please get one more approval from @jayaranigarg.

@AbhitejJohn AbhitejJohn merged commit 28dd7cd into microsoft:master Sep 20, 2017
singhsarab pushed a commit to singhsarab/testfx that referenced this pull request Apr 8, 2019
Revert "Include sign target as part of csproj. (microsoft#269)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants