Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10807 Randomize PointFields in all tests unless explicit reason not to
  3. SOLR-10864

Add static (test only) boolean to PointField indicating 'precisionStep' should be ignored so we can simplify points randomization in our schemas

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      (I'm spinning this idea out of parent jira SOLR-10807 so that it gets it's own jira# w/ it's own summary for increased visibility/comments)

      In the interest of making it easier & more straight forward to get good randomized test coverage of Points fields, I'd like to add the following to the PointField class...

       /**
        * <p>
        * The Test framework can set this global variable to instruct PointField that
        * (on init) it should be tollerant of the <code>precisionStep</code> argument used by TrieFields.
        * This allows for simple randomization of TrieFields and PointFields w/o extensive duplication
        * of <code>&lt;fieldType/&gt;</code> declarations.
        * </p>
        *
        * <p>NOTE: When {@link TrieField} is removed, this boolean must also be removed</p>
        *
        * @lucene.internal
        * @lucene.experimental
        */
       public static boolean TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS = false;
      
       /** 
        * NOTE: This method can be removed completely when
        * {@link #TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS} is removed 
        */
       @Override
       protected void init(IndexSchema schema, Map<String, String> args) {
         super.init(schema, args);
         if (TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS) {
           args.remove("precisionStep");
         }
       }
      

      Then in SolrTestCaseJ4, set PointField.TEST_HACK_IGNORE_USELESS_TRIEFIELD_ARGS on a class by class basis when randomizing Trie/Points (and unset @AfterClass).

      (details to follow in comment)

        Attachments

        1. SOLR-10864.patch
          85 kB
          Hoss Man
        2. SOLR-10864.patch
          128 kB
          Hoss Man
        3. SOLR-10864.patch
          132 kB
          Hoss Man
        4. SOLR-10864.patch
          131 kB
          Hoss Man
        5. SOLR-10864.patch
          130 kB
          Hoss Man
        6. SOLR-10864.patch
          131 kB
          Hoss Man

          Activity

            People

            • Assignee:
              hossman Hoss Man
              Reporter:
              hossman Hoss Man
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: