You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2023/02/08 03:18:00 UTC

[jira] [Commented] (SOLR-16573) SolrClientTestRule for EmbeddedSolrServer

    [ https://issues.apache.org/jira/browse/SOLR-16573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17685664#comment-17685664 ] 

ASF subversion and git services commented on SOLR-16573:
--------------------------------------------------------

Commit 21bc46c43c94cc90589cc536ffc7518908e64240 in solr's branch refs/heads/main from Joshua Ouma
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=21bc46c43c9 ]

SOLR-16573:SolrClientTestRule for EmbeddedSolrServer (#1218)

New SolrClientTestRule abstraction with one implementation: EmbeddedSolrServerTestRule

EmbeddedSolrServerTestBase and AbstractEmbeddedSolrServerTestCase were modified to use this abstraction, and yet were also marked deprecated to encourage direct use of the rule. A solr.xml file is optional. Some affected tests will run more efficiently because (A) they no longer do file I/O to create a temporary solr-home because the rule is able to use existing solr homes and configSets in-place and because (B) initCore() can double-parse a solrconfig.xml and schema.xml.

SolrTestCaseJ4 / SolrTestCase: Moved ObjectReleaseTracker checking to use a Rule so that it's compatible with Rules that use ObjectReleaseTracker.

---------

Co-authored-by: David Smiley <ds...@salesforce.com>

> SolrClientTestRule for EmbeddedSolrServer
> -----------------------------------------
>
>                 Key: SOLR-16573
>                 URL: https://issues.apache.org/jira/browse/SOLR-16573
>             Project: Solr
>          Issue Type: Sub-task
>            Reporter: David Smiley
>            Priority: Major
>          Time Spent: 10h
>  Remaining Estimate: 0h
>
> See parent issue.  Here, create a subclass of ExternalResource (a JUnit TestRule, FYI compatible with JUnit 5) that provides access to a SolrClient, or that might even be one itself (delegating the request method).  Perhaps name this "SolrClientTestRule".  It will have subclasses for specific types, initially just one using EmbeddedSolrServer.  It should have a builder to configure it.  Some test classes can simply configure at its declaration but note that others will need to do so afterwards (e.g. in a \@Before or a test method). This utility should be in the test-framework and be designed to be useful by external projects who write plugins or that want to test with an embedded Solr.  Therefore it should not contain code that assumes the file system of the Solr project itself.
> Out of scope are other implementations, and thus somehow choosing amongst them.
> Use this mechanism in EmbeddedSolrServerTestBase, ensuring that "TestHarness" (from SolrTestCaseJ4) isn't used.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org