Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-16757 Umbrella Ticket for Revamping Solr CLI's for the Future
  3. SOLR-17344

Randomize short/long opts usage in Java-based CLI tests

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • main (10.0)
    • None
    • scripts and tools
    • None

    Description

      We have a decent suite of Java tests that validate "bin/solr" usage, including (but not limited to):

      • AuthToolTest
      • CreateToolTest
      • DeleteToolTest
      • PackageToolTest
      • HealthcheckToolTest
      • SolrCLIZkToolsTest

      Each of these tests triggers a tool with a (mostly hardcoded) set of string-literal parameters, e.g.

          String[] args = {
            "auth",
            "enable",
            "-z",
            cluster.getZkClient().getZkServerAddress(),
            "--auth-conf-dir",
            dir.toAbsolutePath().toString(),
            "--solr-include-file",
            solrIncludeFile.toAbsolutePath().toString(),
            "-credentials",
            "solr:solr",
            "--block-unknown",
            "true"
          };
          assertEquals(0, runTool(args));
      

      Randomizing the parameter names in these invocations would give us better coverage, and increase our confidence when making changes to the CLI syntax (like that done in SOLR-16824)

      Attachments

        Activity

          People

            Unassigned Unassigned
            gerlowskija Jason Gerlowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: