| Project: | Apache Solr Search Integration |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
The following tests cases should be written in order to have a consistent view for new patches that might possible change current functionality
Tests that already exist are already marked
Base Framework (Solr disabled)
Enable moduleapachesolr.index.inc should not be loaded everywhereSearch index should show a notice that no solr instance is connectedSolrBaseQuery unit testSolrFilterSubQuery unit testApacheSolrDocument unit test
Changing Content type
Adding/Modifying taxonomy term
Add a user, add content as that user and modify content
Base Framework (Solr enabled)
Connection should be succesful
DrupalApacheSolrService unit testIndex should be emptySend test content & verify (UTF-8 included)
Modify content & verify
Delete content & verify
index status should be correct with the indexed content
Solr config files should be listed properly
Number of items per cron run should work
On failure, the configured result should show
Delete index
Reindex index
Simple facet testing ? // Not possible, need facetapi for that
Search Environment
Editing an environmentCloning an environment and deleteCreate a new environment and deleteChange read and write setting and verifyAdd a new environment and make it default
Search Pages
Core search page availableEditing the core_search pageClone the core_search pageCreate a new search page and deleteChange search page title
Test search page types (taxonomy) // Not able to check properly without solrChange search page path
Add a custom filter // Not able to check properly without solr
Change results per page // Not able to check properly without solr
Enable/disable spell check // Not able to check properly without solr
Empty search behavior // Not able to check properly without solr
Bias
Analyze content and validate helper functions
Exclude content type
More like this
Add a more like this block
Remove a more like this block
Validate configuration of more like this block
Node Access (Solr Enabled)
Index testing content without access rulesIndex testing content with access rules
Change permission, validate if being reindexed
Comments
#1
First patch.
Base Framework (Solr disabled)
Enable moduleSearch index should show a notice that no solr instance is connectedSolrBaseQuery unit testSolrFilterSubQuery unit test??
ApacheSolrDocument unit testIt seems that the SubQuery test doesn't load and when I try to execute it it is failing. Waiting on response for the status of this subQuery class. Continueing now for the Base Framework tests with Solr enabled
Setting the status on needs review so the test bot can execute all of these tests
#2
The last submitted patch, 1397138-1.patch, failed testing.
#3
Updating, so it does not require apachesolr.module or any db queries to run the apachesolr document unit test
#4
+ add test that verifies we are not loading the apachesolr.index.module on every or certain page loads
#5
Added test to verify this apachesolr.index.module + better subquery tests
#6
Forgot a dsm and reverted a function from private to public. Fixed now
#7
Added interface as separate file to the patch
#8
The last submitted patch, 1397138-7.patch, failed testing.
#9
Added test to clone a search environment
#10
The last submitted patch, 1397138-8.patch, failed testing.
#11
I had to modify the way of the operator in the FilterQuery parser :
Now :
<?phpprotected function rebuildFq() {
$fq = array();
foreach ($this->fields as $pos => $field) {
$fq[] = $this->makeFilterQuery($field);
}
foreach ($this->subqueries as $subquery) {
$subfq = $subquery->rebuildFq();
if ($subfq) {
$operator = $this->operator;
$fq[] = "(" . implode(" $operator ", $subfq) . ")";
}
}
return $fq;
}
?>
Before :
<?phpprotected function rebuildFq() {
$fq = array();
foreach ($this->fields as $pos => $field) {
$fq[] = $this->makeFilterQuery($field);
}
foreach ($this->subqueries as $subquery) {
$subfq = $subquery->rebuildFq();
if ($subfq) {
$operator = $subquery->operator;
$fq[] = "(" . implode(" $operator ", $subfq) . ")";
}
}
return $fq;
}
?>
This has as a consequence that subqueries now have to define their operator in the AddFilterQuery :
$query1 = apachesolr_drupal_query('DrupalTest');
$query2 = apachesolr_drupal_query('DrupalTest');
$query2->addFilter('label', 'bar');
$query3 = apachesolr_drupal_query('DrupalTest');
$query2->addFilter('label', 'baz');
$query1->addFilterSubQuery($query2, 'OR');
$query2->addFilterSubQuery($query3);
// This equals (label:bar OR (label:baz)) (URL = ?fq=(label:bar OR (label:baz)))
// multiple filters in first query
$query1 = apachesolr_drupal_query('DrupalTest');
$query1->addFilter('is_uid', '10');
$query2 = apachesolr_drupal_subquery();
$query2->addFilter('is_uid', '1');
$query2->addFilter('tid', '5');
$query1->addFilterSubQuery($query2, 'OR');
// This equals is_uid:10 (is_uid:1 OR tid:5) (URL = ?fq=is_uid:10&fq=(is_uid:1 OR tid:5))
The first example is easy to make with the previous code, the second example is nearly impossible unless you use an empty base query where you add subqueries to.
#12
#13
The last submitted patch, 1397138-11.patch, failed testing.
#14
After some mysql performance problems there is some update of the testing suite. Now all the tests available should succeed. Let's cross fingers!
#15
#16
Adding search pages tests
#17
Added a clone search page test
#18
per discusison need to leave the operator logic as-is
seems like we need some documentation
#19
Reverted the operator logic and all that came along with it. Attached is the last patch for today regarding the simpletests.
#20
Committed what we have so far. Addons always welcome
#21
Committed all #19 to 6.x-3.x
#22
More simpletests will go in as separate issues. Closing this one
#23
Hmm, second thoughts, reopening
#24
We can always add more when needed. Closing as a final thought :-)