The \Drupal\facetapi\Tests\IntegrationTest is still very tightly coupled to search api and this will break tests on drupal.org because search api is not a hard dependency (see #2609970: Search_api is a needed dependency (for now?) for consulting the config screens).
We completed #2612084: Add a new facet source for drupal core, so this can now be started.
TODO
- Change the integration test so that it doesn't depend on search api anymore but only tests admin pages + keeps
testUrlAlias,testRenameFacet,testOverviewPermissions. It can instead depend on core search. - Add a new CoreSearchIntegrationTest that depends on core search as well but specifically tests the functionality of core search.
- Add a SearchApiIntegrationTest that tests search api specific integration (adding a views page adds a new facet source, test different types of fields, ...)
.2 and .3 can be done in followups because they look like a lot of work. We want to to get a the classes in here already though. This issue adds the needed classes / setup we need to add extra test coverage. I don't think we need extra coverage going out of this, but we can't lose any either.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | untangle_the-2613186-21.patch | 15.53 KB | borisson_ |
Comments
Comment #2
borisson_Updated IS.
Comment #3
marthinal commentedComment #4
marthinal commentedFinally I had time to work on it.
I've detected a couple of issues:
1- class FacetDisplayForm
2- Not sure why the id is built using "--2". And at this moment I have no time to take a look at this part.
class WidgetIntegrationTest
This is a first step. If we need to add- modify tests for the core module or Search API then we should open new issues IMHO :) Otherwise this patch will be too big
Comment #7
marthinal commented2- Fixed.
Let's take a look at the tests results.
Comment #8
borisson_@marthinal, I took a look at the patch, it looks great but next time please use
git diff -M, this reduces the patch size in half because git can actually say that files are moved instead of deleted/added.Anyway, I took a good look at the patch and related code. I think we should fix the issues mentioned in #4 and leave the tests as-is.
The original thought of this issue was enabling testing on d.o, but because we already have that, the reasons for this aren't as strong.
We can add a tests that tests things like the integration test for core search without having to go trough such an extensive rewrite of all the tests.
I'm really sorry that you made all this effort before I thought of this.
Comment #9
borisson_Added a related issue.
Comment #12
borisson_To keep it a little bit easier, we should probably just add an extra integration test for core search, this is an initial patch for that.
Comment #15
marthinal commentedAs discussed with borisson_ we could use the integration test from my last patch.
1) We need to fix #2655382: Copy library from search api into facets..
2) Review that we are covering what we need.
3) I've found a new bug. We have a dependency with views module. We need a new issue to fix the problem.
Comment #20
borisson_Overall this is looking great, I did find some smaller issues with the code though.
Nice, this makes a good distinction between the base classes, marthinal++
I think this comment can be updated.
Tests the admin UI with the core search facet source.This should be
@param string $facet_namefor coding standards.This method can be protected. We don't need it to be public.
We can probably remove the "Helper function:" here, other methods don't have that indication.
unneeded blank line.
Why is this in comment?
Does this not work?
Unneeded blank line
Can we figure out why this is, are the dependencies not calculated as expected?
We don't need this module, I think.
Either change the comment or the number here, because it's not correct.
Coding standards, should be
for ($i =0; $i < 10; $i++) {Can we add the iterator's value to the title / body?
'title' => 'foo bar: ' . $isee above.
Comment #21
borisson_Resolved my own issues, if this is green we can commit this and do the followup in #2655414: Avoid dependency on VIEWS module.
Comment #23
borisson_Thanks again for your contribution, committed. See you in the related issues for follow-ups.