forked from TrueCloudLab/s3-tests
add filter for s3select tests
Signed-off-by: gal salomon <gal.salomon@gmail.com>
(cherry picked from commit fce9a52ef4
)
This commit is contained in:
parent
10c801a2e0
commit
6ea6cb6467
1 changed files with 13 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
||||||
import nose
|
import nose
|
||||||
import random
|
import random
|
||||||
|
from nose.plugins.attrib import attr
|
||||||
|
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
get_client
|
get_client
|
||||||
|
@ -60,6 +62,7 @@ def generate_s3select_expression_projection(bucket_name,obj_name):
|
||||||
# both results should be close (epsilon)
|
# both results should be close (epsilon)
|
||||||
assert (1 - (float(res.split("\n")[1]) / eval( e )) ) < epsilon
|
assert (1 - (float(res.split("\n")[1]) / eval( e )) ) < epsilon
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_generate_where_clause():
|
def test_generate_where_clause():
|
||||||
|
|
||||||
# create small csv file for testing the random expressions
|
# create small csv file for testing the random expressions
|
||||||
|
@ -71,6 +74,7 @@ def test_generate_where_clause():
|
||||||
for _ in range(100):
|
for _ in range(100):
|
||||||
generate_s3select_where_clause(bucket_name,obj_name)
|
generate_s3select_where_clause(bucket_name,obj_name)
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_generate_projection():
|
def test_generate_projection():
|
||||||
|
|
||||||
# create small csv file for testing the random expressions
|
# create small csv file for testing the random expressions
|
||||||
|
@ -156,6 +160,7 @@ def create_list_of_int(column_pos,obj,field_split=",",row_split="\n"):
|
||||||
|
|
||||||
return list_of_int
|
return list_of_int
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_count_operation():
|
def test_count_operation():
|
||||||
csv_obj_name = "csv_star_oper"
|
csv_obj_name = "csv_star_oper"
|
||||||
bucket_name = "test"
|
bucket_name = "test"
|
||||||
|
@ -166,6 +171,7 @@ def test_count_operation():
|
||||||
|
|
||||||
nose.tools.assert_equal( num_of_rows, int( res ))
|
nose.tools.assert_equal( num_of_rows, int( res ))
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_column_sum_min_max():
|
def test_column_sum_min_max():
|
||||||
csv_obj = create_random_csv_object(10000,10)
|
csv_obj = create_random_csv_object(10000,10)
|
||||||
|
|
||||||
|
@ -224,6 +230,7 @@ def test_column_sum_min_max():
|
||||||
|
|
||||||
nose.tools.assert_equal( int(count)*4 , int(sum1)-int(sum2) )
|
nose.tools.assert_equal( int(count)*4 , int(sum1)-int(sum2) )
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_complex_expressions():
|
def test_complex_expressions():
|
||||||
|
|
||||||
# purpose of test: engine is process correctly several projections containing aggregation-functions
|
# purpose of test: engine is process correctly several projections containing aggregation-functions
|
||||||
|
@ -255,6 +262,7 @@ def test_complex_expressions():
|
||||||
|
|
||||||
nose.tools.assert_equal( res_s3select_between_numbers, res_s3select_eq_modolu)
|
nose.tools.assert_equal( res_s3select_between_numbers, res_s3select_eq_modolu)
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_alias():
|
def test_alias():
|
||||||
|
|
||||||
# purpose: test is comparing result of exactly the same queries , one with alias the other without.
|
# purpose: test is comparing result of exactly the same queries , one with alias the other without.
|
||||||
|
@ -275,6 +283,7 @@ def test_alias():
|
||||||
nose.tools.assert_equal( res_s3select_alias, res_s3select_no_alias)
|
nose.tools.assert_equal( res_s3select_alias, res_s3select_no_alias)
|
||||||
|
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_alias_cyclic_refernce():
|
def test_alias_cyclic_refernce():
|
||||||
|
|
||||||
number_of_rows = 10000
|
number_of_rows = 10000
|
||||||
|
@ -292,6 +301,7 @@ def test_alias_cyclic_refernce():
|
||||||
|
|
||||||
assert int(find_res) >= 0
|
assert int(find_res) >= 0
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_datetime():
|
def test_datetime():
|
||||||
|
|
||||||
# purpose of test is to validate date-time functionality is correct,
|
# purpose of test is to validate date-time functionality is correct,
|
||||||
|
@ -325,6 +335,7 @@ def test_datetime():
|
||||||
|
|
||||||
nose.tools.assert_equal( res_s3select_date_time_utcnow, res_s3select_count)
|
nose.tools.assert_equal( res_s3select_date_time_utcnow, res_s3select_count)
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_csv_parser():
|
def test_csv_parser():
|
||||||
|
|
||||||
# purpuse: test default csv values(, \n " \ ), return value may contain meta-char
|
# purpuse: test default csv values(, \n " \ ), return value may contain meta-char
|
||||||
|
@ -364,6 +375,7 @@ def test_csv_parser():
|
||||||
res_s3select_alias = remove_xml_tags_from_result( run_s3select(bucket_name,csv_obj_name,"select _9 from stdin;") ).replace("\n","")
|
res_s3select_alias = remove_xml_tags_from_result( run_s3select(bucket_name,csv_obj_name,"select _9 from stdin;") ).replace("\n","")
|
||||||
nose.tools.assert_equal( res_s3select_alias, ',')
|
nose.tools.assert_equal( res_s3select_alias, ',')
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_csv_definition():
|
def test_csv_definition():
|
||||||
|
|
||||||
number_of_rows = 10000
|
number_of_rows = 10000
|
||||||
|
@ -393,6 +405,7 @@ def test_csv_definition():
|
||||||
nose.tools.assert_equal( res_s3select, __res )
|
nose.tools.assert_equal( res_s3select, __res )
|
||||||
|
|
||||||
|
|
||||||
|
@attr('s3select')
|
||||||
def test_schema_definition():
|
def test_schema_definition():
|
||||||
|
|
||||||
number_of_rows = 10000
|
number_of_rows = 10000
|
||||||
|
|
Loading…
Reference in a new issue