Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-15965

Shell test changes. Use @shell.command instead directly calling functions in admin.rb and other libraries.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0, 2.0.0
    • None
    • None

    Description

      Testing by executing a command will cover the exact path users will trigger, so its better then directly calling library functions in tests. Changing the tests to use @shell.command(:<command>, args) to execute them like it's a command coming from shell.

      Norm change:
      Commands should print the output user would like to see, but in the end, should also return the relevant value. This way:

      • Tests can use returned value to check that functionality works
      • Tests can capture stdout to assert particular kind of output user should see.
      • We do not print the return value in interactive mode and keep the output clean. See Shell.command() function.

      Bugs found due to this change:

      • Uncovered bug in major_compact.rb with this approach. It was calling admin.majorCompact() which doesn't exist but our tests didn't catch it since they directly tested admin.major_compact()
      • Enabled TestReplicationShell. If it's bad, flaky infra will take care of it.

      Attachments

        1. HBASE-15965.master.003.patch
          53 kB
          Apekshit Sharma
        2. HBASE-15965.master.002.patch
          50 kB
          Apekshit Sharma
        3. HBASE-15965.master.001.patch
          47 kB
          Apekshit Sharma

        Issue Links

          Activity

            People

              appy Apekshit Sharma
              appy Apekshit Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: