Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The current tests aren't running due to low-level errors.
Proposed resolution
Get the tests running again, and ideally passing.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#32 | travis-fixes-2595077-32.patch | 2.05 KB | Berdir |
#31 | 80.patch | 8.17 KB | Berdir |
#24 | 2595077-24--fix_test_suite.patch | 43.65 KB | drunken monkey |
#4 | 2595077-04.patch | 4.29 KB | Berdir |
#2 | 2595077-02.patch | 1.6 KB | jhedstrom |
Comments
Comment #2
jhedstromThis doesn't get them all passing, but allows them all to run.
Comment #3
BerdirCan we install the config with a manual call from setUp(), that's a bit too much magic for me.
Comment #4
BerdirRe-rolled, I didn't need the installConfig() override method.
This doesn't pass yet but currently you get a fatal error even when just trying to discover tests, due to the moved parent class. Committing this is as stop-gap fix for that. I get at least somewhere into actually running the test now with this.
Comment #6
BerdirCommitted this, back to active.
Comment #8
BerdirTests look a lot better now with #2636270: Head broken committed too. A bunch of facet tests fail, some regression tests fail, e.g. related to case sensitivity but looks fine otherwise.
Don't know enough about those topics to fix these tests myself.
Comment #9
borisson_I'll get a solr instance working again locally so I can get all of them to pass, at least this patch will be useful because of the changes in the config schema.
Comment #10
borisson_Comment #11
borisson_I was too eager in my c/p of the db index schema. This should be better.
Comment #12
borisson_I can't figure out why the testcode doesn't return expected facets, while the code does work in my local test-setup.
I did add some extra assertions in search api to help me figure out why this was failing, those are green though. So at least that's working as expected. #2658120: Expand Backend test.
When running tests, the
$resultset->getFacetSet()
basically returns an empty string with a count of 2, while on my actual test-site the correct facets are being returned.Comment #13
borisson_I still can't figure it out, but at least here's a patch with an extra test that only tests the facets and more comments in the code of what's happening and supposed to happen.
I will come back to this; but probably not today/tomorrow.
Comment #14
borisson_This is driving me insane.
I added an integration test to make sure the solr integration in the backend works. This is a copy of the integration test in search api; with a whole bunch of tests removed. I don't think it's needed to test all edge cases of the backend. The strict config checking there made me find a small issue with the config schema. Fix attached.
Comment #15
borisson_More code in the tests. Still not green. I think the problem is in
SearchApiSolrBackend::setFacets
.Comment #16
BerdirThis is a checkbox/boolean I think, not a string.
Comment #17
borisson_Fixed #16.
Comment #18
BerdirHaven't fully reviewed everything yet. Do you think we should commit this and then continue with fixing the remaining test fails?
Comment #19
borisson_@Berdir, the latest patch doesn't break as hard as without the patch, but tests are still red. So I don't think it really matters a lot.
Comment #20
drunken monkeyI don't think it'll happen in the next week, but if I get the time to take a look at this – how do I actually run the tests? Does it work just by running the normal test suite, or are there special steps to do?
Comment #21
borisson_You need to have a solr instance at:
http://localhost:8983/solr/d8/
but that's all you need to run the tests.Comment #22
drunken monkeyOK, thanks!
Should we maybe add that to the test class documentation?
Comment #23
borisson_I think it should be added in the
readme.txt
instead of the testclass, so we won't have to copy that text over to other test classes.Comment #24
drunken monkeyThe attached works for me. Please test/review!
Comment #26
drunken monkeyCreated a Github PR, too, so we can see whether the tests really pass for all environments. (Though, since they currently aren't running at all, I guess we might as well just have committed it and seen afterwards.)
Comment #27
drunken monkey"Drupal\Tests\search_api_solr\Kernel\SearchApiSolrTest 1 passes"
That seems like it failed to find the Solr instance, or Travis failed to install it. That's something I know nothing about, so would be great if someone else could take a look.
Comment #29
drunken monkeyCommitted.
Setting back to "Active" for fixing Travis to correctly detect passing/failing build.
Comment #30
BerdirStarted to work on that here: https://github.com/amateescu/search_api_solr/pull/80
Comment #31
BerdirOk, that now seems to be working as expected.
I thought that the manual parsing is no longer required and run-tests.sh should return 1/0 correct, but it somehow doesn't yet.
Note that we currently have an error reported at the end of the test that is not properly checked. This is actually great because it means that we basically have test coverage for #2685035: Avoid redundant data in configuration already. So once this is in, we just have to re-check the patch there (with a PR) and possibly add an explicit assertion somewhere, it just fails through the error log parsing.
I also had to change the regex that's looking for errors so it matches those.
Comment #32
BerdirHm, that patch isn't what I expected.
Comment #33
BerdirOk, committed. I think we can close this now, despite still having some test fails, we'll take care of that in the referenced issue.