Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
ghx-label-11
Description
Currently, when writing pytest that exercise custom query option values, we need to declare it by making new test dimension, followed by deepcopying the original vector, and inserting the selected dimension value into 'exec_option' dictionary in generated vector. This this an example of testing mt_dop in TestRuntimeFilters.test_basic_filters:
def add_test_dimensions(cls): super(TestRuntimeFilters, cls).add_test_dimensions() cls.ImpalaTestMatrix.add_dimension(ImpalaTestDimension('mt_dop', 0, 1)) def test_basic_filters(self, vector): new_vector = deepcopy(vector) new_vector.get_value('exec_option')['mt_dop'] = vector.get_value('mt_dop')
This is required to ensure pairwise and exhaustive combination is generated correctly. On the other hand, this can be error prone and tedious when a pytest class has many test methods. Such mistakes can be seen here where the test methods forgot to append 'disable_optimized_iceberg_v2_read' dimension into 'exec_option' dictionary.
https://github.com/apache/impala/blob/master/tests/query_test/test_iceberg.py#L1188-L1189
Ideally, this 'exec_option' population should happen automatically in test_vector.py during vector generation.