HCatalog
  1. HCatalog
  2. HCATALOG-374

Add HCatBaseTest and one example usage

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5
    • Component/s: None
    • Labels:
      None

      Description

      Many tests could be simplified by moving HiveMetaStore driver/client setup to a base class. Here's an example moving one test over. If this looks good we can lazily convert the rest.

      This is a no-op change. I was fussing with something that broke this test and decided to make these updates while in there.

        Activity

        Travis Crawford made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Alan Gates made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Fix Version/s 0.5 [ 12320147 ]
        Resolution Fixed [ 1 ]
        Hide
        Alan Gates added a comment -

        It seems reasonable to start by migrating this part. We can migrate more functionality to the base class later as needed.

        Show
        Alan Gates added a comment - It seems reasonable to start by migrating this part. We can migrate more functionality to the base class later as needed.
        Hide
        Travis Crawford added a comment -

        This came back up while adding a test in HCATALOG-373.

        I think there's value checking this in as-is because most tests need access to the metastore, which this simplifies and will let developers setup in a consistent way. The main reason for not moving createInputData is because I haven't looked into how most tests setup their data. If we can get this checked in I don't mind doing a refactoring pass to switch over the tests where this would make sense.

        The reason this came up again is because the test I was running (HCatMapReduceTest) doesn't set the warehouse dir in the conf inside the test; this breaks adding the test in my IDE, which is much faster than running from the command line.

        If checking this in sounds good I can update against trunk which is probably needed; also, if you want I can update the tests as part of adding this base class. Since there are a bunch perhaps I could do them in a small number of batches, since huge diffs are both hard to read and often are challenging to keep up-to-date against an active code base.

        Thoughts?

        Show
        Travis Crawford added a comment - This came back up while adding a test in HCATALOG-373 . I think there's value checking this in as-is because most tests need access to the metastore, which this simplifies and will let developers setup in a consistent way. The main reason for not moving createInputData is because I haven't looked into how most tests setup their data. If we can get this checked in I don't mind doing a refactoring pass to switch over the tests where this would make sense. The reason this came up again is because the test I was running (HCatMapReduceTest) doesn't set the warehouse dir in the conf inside the test; this breaks adding the test in my IDE, which is much faster than running from the command line. If checking this in sounds good I can update against trunk which is probably needed; also, if you want I can update the tests as part of adding this base class. Since there are a bunch perhaps I could do them in a small number of batches, since huge diffs are both hard to read and often are challenging to keep up-to-date against an active code base. Thoughts?
        Hide
        Alan Gates added a comment -

        You migrated part of TestHCatHiveCompatibility.setUp to HCatBaseTest, but not the part that forms the new method createInputData. Why? I can see splitting these into two methods, but will no other tests needs the functionality of createInputData? Shouldn't it be migrated too?

        Show
        Alan Gates added a comment - You migrated part of TestHCatHiveCompatibility.setUp to HCatBaseTest, but not the part that forms the new method createInputData. Why? I can see splitting these into two methods, but will no other tests needs the functionality of createInputData? Shouldn't it be migrated too?
        Travis Crawford made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Travis Crawford made changes -
        Field Original Value New Value
        Attachment HCATALOG-374_base_test_class.diff [ 12522523 ]
        Travis Crawford created issue -

          People

          • Assignee:
            Travis Crawford
            Reporter:
            Travis Crawford
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development