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

Use framework prefilter for massive perf improvement when running fra… #553

Merged
merged 3 commits into from
Aug 9, 2019

Conversation

MatthewBeardmore
Copy link

@MatthewBeardmore MatthewBeardmore commented Oct 13, 2018

Related to #529

Implements creation of a prefilter only when VS is passing in a list of test cases. As OsirisTerje is already working on prefiltering with the TfsTestFilter, I didn't work on implementing anything else with preflighting in that method. VS seems to pass in a list of test cases when you are running a single test, which does not pass in a TfsTestFilter, and therefore, shouldn't affect his work.

…ction of tests

Implements creation of a prefilter only when VS is passing in a list of test cases. As OsirisTerje is already working on prefiltering with the TfsTestFilter, I didn't work on implementing anything else with preflighting in that method. VS seems to pass in a list of test cases when you are running a single test, which does not pass in a TfsTestFilter, and therefore, shouldn't affect his work.
@jnm2 jnm2 requested a review from OsirisTerje October 16, 2018 00:25
if (end > 0)
prefilters.Add(testCase.FullyQualifiedName.Substring(0, end));
else
prefilters.Add(testCase.FullyQualifiedName);
Copy link
Contributor

Choose a reason for hiding this comment

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

@OsirisTerje Can you think of any edge cases for this?

Copy link
Author

Choose a reason for hiding this comment

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

I took this code from the NUnitLite code as I was looking for how it did prefiltering. Based on my (very limited) understanding of how VS is working here, it should always match what NUnit generates? But I'm not 100% sure either.

@jnm2
Copy link
Contributor

jnm2 commented Oct 16, 2018

@OsirisTerje how do you think this should be tested?

@OsirisTerje
Copy link
Member

OsirisTerje commented Oct 21, 2018

@MatthewBeardmore @jnm2 Sorry for responding late here. What we do today is to use a name filter. When we add the prefilter for the LOAD, it is then given that the results will be equal? Referring back to the other discussion, this kind of filter, - shouldn't it be part of the engine?

It would be nice to have a repro solution that we A) measure todays speed and number of tests as a baseline. And then using the new adapter verify B) new adapter speed and C) That number of tests are identical to A). I think this repro should have 1) a lot of tests (we have generated tests in the order of 10000*N earlier) 2) a variety of tests, using different ways of defining them, e.g. test, testcase and testcasesource.

@OsirisTerje
Copy link
Member

@MatthewBeardmore Can you fix the conflicts ?

Would like to get this into the 3.13 release this month.

@OsirisTerje OsirisTerje added this to the 3.13 milestone Jan 14, 2019
@OsirisTerje OsirisTerje modified the milestones: 3.13, 3.14 Feb 20, 2019
@Dreamescaper
Copy link
Member

@OsirisTerje
Is there anything apart from conflicts preventing from merging?
I'd like it to be merged, so willing to pick it up (unless @MatthewBeardmore wants to finish it, of course).

@OsirisTerje
Copy link
Member

OsirisTerje commented Jul 10, 2019

@Dreamescaper Very good if you can continue on this. You will have to make your own PR though.
The conflicts are one thing, should be easy to fix though.
But it really needs proper testing, so if you can get something done there to ensure we don't break anything with this, that would be awesome.
It should be tested both in VS and on command line (using vstest.console and dotnet test) after the changes.
@MatthewBeardmore also has some comments for the code where he express he is not 100% sure about all the changes. Those in particular needs to be tested properly.

I have also some concerns about the changes here adding more parameters to several methods, but haven't looked closely into it. Also the introduction of "null" parameters doesn't feel all that good. It might have to be like that of course, but a second look would not harm :-)

@Dreamescaper
Copy link
Member

I'll take a closer look, and will investigate if existing filtering coverage should be extended.

I'll clarify, though.

It should be tested both in VS and on command line (using vstest.console and dotnet test) after the changes.

Are we talking about some manual checklist, or covered as integration tests?

@OsirisTerje
Copy link
Member

We have some acceptance tests, see cake acceptance tests script and the separate project for that, but it doesn't cover all cases, so yes, we still have to do manual tests.
The other unit tests may cover part of this, but I haven't checked in this case.

# Conflicts:
#	src/NUnitTestAdapter/NUnit3TestExecutor.cs
#	src/NUnitTestAdapter/NUnitTestAdapter.cs
@MatthewBeardmore
Copy link
Author

Sorry, I've been busy for months... I've fixed up the merge conflicts. Let me know if there's anything else that you need. I realize this isn't comprehensive testing by any means, but I've been using this change internally since I created this branch and haven't run into any issues at this point.

@OsirisTerje OsirisTerje modified the milestones: 3.14, 3.15 Aug 8, 2019
@OsirisTerje OsirisTerje merged commit 1c4fbca into nunit:master Aug 9, 2019
@OsirisTerje
Copy link
Member

OsirisTerje commented Aug 9, 2019

@MatthewBeardmore The prerelease is now available at Install-Package NUnit3TestAdapter -Version 3.15.0-dev-01118 -Source https://www.myget.org/F/nunit/api/v3/index.json . Can you check this out?

I'm planning on releasing this separately next week, but will like some more checks on it. This issue and PR will then be the only one in that release.

@Dreamescaper If you have the possibility to check it out too, it would be awesome.

@MatthewBeardmore
Copy link
Author

Sure, I'm adding it today.

@OsirisTerje
Copy link
Member

@MatthewBeardmore Any news ?

@MatthewBeardmore
Copy link
Author

I haven't seen any issues with it so far.

@OsirisTerje
Copy link
Member

Cool, thanks! I'll get it released within a few days.

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