Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scylla serialization tests #384

Merged
merged 7 commits into from
Jan 26, 2025

Conversation

illia-li
Copy link

@illia-li illia-li commented Jan 17, 2025

Changes:

  1. Added serialization tests for cql simple types. The counter type is not included.
  2. Fixed timeuuid. Marshaling zeroUUID returns make([]byte,16) before, now returns make([]byte,0)
  3. Added values test cases for uuid, timeuuid, inet, float, double cql types into unit tests.

Here are the contents of the tables selected by cqlsh:
test_ascii:

test_id | test_col
---------+-------------
     val | test string
     nil |        null
   zeros | 

test_bigint:

 test_id | test_col
---------+----------------------
     min | -9223372036854775808
     nil |                 null
   zeros |                    0
      +1 |                    1
      -1 |                   -1
     max |  9223372036854775807

test_blob:

 test_id | test_col
---------+--------------------------
     val | 0x7465737420737472696e67
     nil |                     null
   zeros |                       0x

test_boolean:

 test_id | test_col
---------+----------
     min |    False
     nil |     null
     max |     True

test_date:

 test_id | test_col
---------+-------------
     nil |        null
   zeros | -2147483648
     mid |  1970-01-01
     max |  2147483647
       1 | -2147483647

test_decimal:

 test_id | test_col
---------+------------------------------
     min | -9.223372036854775808E+32786
     nil |                         null
   zeros |                            0
     max |  9.223372036854775807E-32749

test_double:

 test_id      | test_col
--------------+--------------
          min | -1.7977e+308
          nil |         null
        zeros |            0
          max |  1.7977e+308
 smallest_pos |  4.9407e-324
 smallest_neg | -4.9407e-324

test_duration:

 test_id | test_col
---------+--------------------------------------------------------
     min | -178956970y8mo2147483648d2562047h47m16s854ms775us808ns
     nil |                                                   null
   zeros |                                                       
      +1 |                                               1mo1d1ns
      -1 |                                              -1mo1d1ns
     max |  178956970y7mo2147483647d2562047h47m16s854ms775us807ns

test_float:

 test_id      | test_col
--------------+-------------
          min | -3.4028e+38
          nil |        null
        zeros |           0
          max |  3.4028e+38
 smallest_pos |  1.4013e-45
 smallest_neg | -1.4013e-45

test_inet:

 test_id | test_col
---------+-----------------------------------------
 v4zeros |                                 0.0.0.0
     nil |                                    null
   v4max |                         255.255.255.255
   v6max | ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
 v6zeros |                                      ::

test_int:

 test_id | test_col
---------+-------------
     min | -2147483648
     nil |        null
   zeros |           0
      +1 |           1
      -1 |          -1
     max |  2147483647

test_smallint:

 test_id | test_col
---------+----------
     min |   -32768
     nil |     null
   zeros |        0
      +1 |        1
      -1 |       -1
     max |    32767

test_text:

 test_id | test_col
---------+-------------
     val | test string
     nil |        null
   zeros |            

test_time:

 test_id | test_col
---------+--------------------
     nil |               null
   zeros | 00:00:00.000000000
     max | 23:59:59.999999999

test_timestamp:

 test_id | test_col
---------+---------------------------------
     min |            -9223372036854775808
     nil |                            null
   zeros | 1970-01-01 00:00:00.000000+0000
      +1 | 1970-01-01 00:00:00.001000+0000
      -1 | 1969-12-31 23:59:59.999000+0000
     max |             9223372036854775807

test_timeuuid:

 test_id | test_col
---------+--------------------------------------
     val | e939f52a-d690-11ef-9cd2-0242ac120002
     nil |                                 null
   zeros | 00000000-0000-1000-0000-000000000000
     max | ffffffff-ffff-1fff-ffff-ffffffffffff

test_tinyint:

 test_id | test_col
---------+----------
     min |     -128
     nil |     null
   zeros |        0
      +1 |        1
      -1 |       -1
     max |      127

test_uuid:

 test_id | test_col
---------+--------------------------------------
     val | e939f52a-d690-11ef-9cd2-0242ac120002
     nil |                                 null
   zeros | 00000000-0000-0000-0000-000000000000
     max | ffffffff-ffff-ffff-ffff-ffffffffffff

test_varchar:

 test_id | test_col
---------+-------------
     val | test string
     nil |        null
   zeros |          

test_varint:

 test_id | test_col
---------+----------------------
     min | -9223372036854775808
     nil |                 null
   zeros |                    0
      +1 |                    1
      -1 |                   -1
     max |  9223372036854775807

@illia-li illia-li force-pushed the il/add/tests/db_serialization branch from bc4855c to 0537599 Compare January 17, 2025 17:41
@dkropachev dkropachev marked this pull request as draft January 17, 2025 18:03
@dkropachev
Copy link
Collaborator

@illia-li , it should not be cassandra tests, it should be integration data type tests.

@illia-li illia-li force-pushed the il/add/tests/db_serialization branch 9 times, most recently from 5b52cc4 to 99c3a80 Compare January 19, 2025 19:51
@illia-li illia-li changed the title Add Cassandra serialization tests Add scylla serialization tests Jan 19, 2025
@illia-li illia-li force-pushed the il/add/tests/db_serialization branch from 99c3a80 to 62bb700 Compare January 19, 2025 20:09
dkropachev
dkropachev previously approved these changes Jan 19, 2025
tests/serialization/marshal_13_uuids_test.go Show resolved Hide resolved
tests/serialization/marshal_13_uuids_test.go Show resolved Hide resolved
integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
@dkropachev
Copy link
Collaborator

@illia-li , also please run this suite, then take cqlsh and run select * from <case_table> and attache results here.
To make sure python-driver provides same results.

integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
integration_serialization_scylla_test.go Outdated Show resolved Hide resolved
@illia-li
Copy link
Author

@illia-li , also please run this suite, then take cqlsh and run select * from <case_table> and attache results here. To make sure python-driver provides same results.

I added equaling tables content which is get by cqlsh.

@illia-li illia-li force-pushed the il/add/tests/db_serialization branch 7 times, most recently from 83214b6 to f9b0a7d Compare January 21, 2025 20:38
@illia-li illia-li requested a review from dkropachev January 21, 2025 21:00
@illia-li illia-li force-pushed the il/add/tests/db_serialization branch from f9b0a7d to 0c49988 Compare January 22, 2025 21:24
@dkropachev dkropachev marked this pull request as ready for review January 23, 2025 13:43
@illia-li illia-li force-pushed the il/add/tests/db_serialization branch from 0c49988 to 8671121 Compare January 24, 2025 13:41
@illia-li illia-li requested a review from dkropachev January 24, 2025 13:46
@illia-li illia-li force-pushed the il/add/tests/db_serialization branch 2 times, most recently from 0fec673 to 8efcb72 Compare January 24, 2025 17:57
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
internal/tests/serialization/valcases/simple.go Outdated Show resolved Hide resolved
@illia-li illia-li force-pushed the il/add/tests/db_serialization branch from 8efcb72 to ae20dbf Compare January 25, 2025 11:24
@illia-li illia-li requested a review from dkropachev January 25, 2025 17:09
@dkropachev dkropachev merged commit 597d7e3 into scylladb:master Jan 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants