import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestHBaseQueries(ImpalaTestSuite):
  @classmethod
  def get_workload(self):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestHBaseQueries, cls).add_test_dimensions()
    cls.TestMatrix.add_constraint(\
        lambda v: v.get_value('table_format').file_format == 'hbase')

  def test_hbase_scan_node(self, vector):
    self.run_test_case('QueryTest/hbase-scan-node', vector)

  def test_hbase_row_key(self, vector):
    self.run_test_case('QueryTest/hbase-rowkeys', vector)

  def test_hbase_filters(self, vector):
    self.run_test_case('QueryTest/hbase-filters', vector)

  def test_hbase_inserts(self, vector):
    self.run_test_case('QueryTest/hbase-inserts', vector)

  def test_hbase_subquery(self, vector):
    self.run_test_case('QueryTest/hbase-subquery', vector)

import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestHBaseQueries(ImpalaTestSuite):
  @classmethod
  def get_workload(self):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestHBaseQueries, cls).add_test_dimensions()
    cls.TestMatrix.add_constraint(\
        lambda v: v.get_value('table_format').file_format == 'hbase')

  def test_hbase_scan_node(self, vector):
    self.run_test_case('QueryTest/hbase-scan-node', vector)

  def test_hbase_row_key(self, vector):
    self.run_test_case('QueryTest/hbase-rowkeys', vector)

  def test_hbase_filters(self, vector):
    self.run_test_case('QueryTest/hbase-filters', vector)

  def test_hbase_inserts(self, vector):
    try:
      self.run_test_case('QueryTest/hbase-inserts', vector)
    except AssertionError:
      msg = ('IMPALA-579 - Insert into a binary encoded hbase table produces'
             ' incorrect results')
      pytest.xfail(msg)

  def test_hbase_subquery(self, vector):
    self.run_test_case('QueryTest/hbase-subquery', vector)

Disable some tests in test_hbase_insert to fix the build.
Disable some tests in test_hbase_insert to fix the build.

Change-Id: I037b292d0eb93c5c743a201b2045eb2ba0712ae7
Reviewed-on: http://gerrit.ent.cloudera.com:8080/387
Reviewed-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@cloudera.com>
Tested-by: Ishaan Joshi <d1d1e60202ec9f2503deb1b724986485a125d802@cloudera.com>

  import logging
  import pytest
  from tests.common.test_vector import *
  from tests.common.impala_test_suite import *
  
  class TestHBaseQueries(ImpalaTestSuite):
    @classmethod
    def get_workload(self):
      return 'functional-query'
  
    @classmethod
    def add_test_dimensions(cls):
      super(TestHBaseQueries, cls).add_test_dimensions()
      cls.TestMatrix.add_constraint(\
          lambda v: v.get_value('table_format').file_format == 'hbase')
  
    def test_hbase_scan_node(self, vector):
      self.run_test_case('QueryTest/hbase-scan-node', vector)
  
    def test_hbase_row_key(self, vector):
      self.run_test_case('QueryTest/hbase-rowkeys', vector)
  
    def test_hbase_filters(self, vector):
      self.run_test_case('QueryTest/hbase-filters', vector)
  
    def test_hbase_inserts(self, vector):
+     try:
-     self.run_test_case('QueryTest/hbase-inserts', vector)
+       self.run_test_case('QueryTest/hbase-inserts', vector)
+     except AssertionError:
+       msg = ('IMPALA-579 - Insert into a binary encoded hbase table produces'
+              ' incorrect results')
+       pytest.xfail(msg)
  
    def test_hbase_subquery(self, vector):
      self.run_test_case('QueryTest/hbase-subquery', vector)
  
Disable some tests in test_hbase_insert to fix the build.
## Code Before:
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestHBaseQueries(ImpalaTestSuite):
  @classmethod
  def get_workload(self):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestHBaseQueries, cls).add_test_dimensions()
    cls.TestMatrix.add_constraint(\
        lambda v: v.get_value('table_format').file_format == 'hbase')

  def test_hbase_scan_node(self, vector):
    self.run_test_case('QueryTest/hbase-scan-node', vector)

  def test_hbase_row_key(self, vector):
    self.run_test_case('QueryTest/hbase-rowkeys', vector)

  def test_hbase_filters(self, vector):
    self.run_test_case('QueryTest/hbase-filters', vector)

  def test_hbase_inserts(self, vector):
    self.run_test_case('QueryTest/hbase-inserts', vector)

  def test_hbase_subquery(self, vector):
    self.run_test_case('QueryTest/hbase-subquery', vector)

## Instruction:
Disable some tests in test_hbase_insert to fix the build.
## Code After:
import logging
import pytest
from tests.common.test_vector import *
from tests.common.impala_test_suite import *

class TestHBaseQueries(ImpalaTestSuite):
  @classmethod
  def get_workload(self):
    return 'functional-query'

  @classmethod
  def add_test_dimensions(cls):
    super(TestHBaseQueries, cls).add_test_dimensions()
    cls.TestMatrix.add_constraint(\
        lambda v: v.get_value('table_format').file_format == 'hbase')

  def test_hbase_scan_node(self, vector):
    self.run_test_case('QueryTest/hbase-scan-node', vector)

  def test_hbase_row_key(self, vector):
    self.run_test_case('QueryTest/hbase-rowkeys', vector)

  def test_hbase_filters(self, vector):
    self.run_test_case('QueryTest/hbase-filters', vector)

  def test_hbase_inserts(self, vector):
    try:
      self.run_test_case('QueryTest/hbase-inserts', vector)
    except AssertionError:
      msg = ('IMPALA-579 - Insert into a binary encoded hbase table produces'
             ' incorrect results')
      pytest.xfail(msg)

  def test_hbase_subquery(self, vector):
    self.run_test_case('QueryTest/hbase-subquery', vector)
