Skip to content

Conversation

@kevinAlbs
Copy link
Contributor

Summary

Regenerate edges_*.cstruct and mincover_*.cstruct test files. No functional changes are expected.

Background & Motivation

This PR is intended as a precursor to MONGOCRYPT-702. The work-in-progress for SERVER-91788 includes changes to test data that served as a source of the edges_*.cstruct and mincover_*.cstruct files in libmongocrypt.

This PR takes the opportunity to update test data for libmongocrypt using the make_includes.py script introduced in #522. make_includes.py was used to generate test data for decimal128, but was not used for the other types. This is intended to reduce the diff once test data is changed.

Server tests were used from https://github.com/10gen/mongo/commit/54e4cc6160eab62877d24a00a5cf2eee0dc2d4b5 and copied as follows:

SERVER_PATH=/Users/kevin.albertson/code/mongo
MONGOCRYPT_PATH=/Users/kevin.albertson/code/tasks/libmongocrypt-M702

# Update edge tests:
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/edges_int32.cstruct edges > $MONGOCRYPT_PATH/test/data/range-edge-generation/edges_int32.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/edges_int64.cstruct edges > $MONGOCRYPT_PATH/test/data/range-edge-generation/edges_int64.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/edges_double.cstruct edges > $MONGOCRYPT_PATH/test/data/range-edge-generation/edges_double.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/edges_decimal128.cstruct edges > $MONGOCRYPT_PATH/test/data/range-edge-generation/edges_decimal128.cstruct
# Update mincover tests:
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_int32.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_int32.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_int64.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_int64.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_double.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_double.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_double_precision.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_double_precision.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_decimal128.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_decimal128.cstruct
python $MONGOCRYPT_PATH/test/util/make_includes.py < $SERVER_PATH/src/mongo/crypto/test_vectors/mincover_decimal128_precision.cstruct mincovers > $MONGOCRYPT_PATH/test/data/range-min-cover/mincover_decimal128_precision.cstruct

kevinAlbs added 3 commits July 9, 2024 10:54
The `min` and `max` are not used for edge generation when double does not include precision. `min` and `max` are also unnecessarily included in the server test data. Keep in libmongocrypt for consistency.
@kevinAlbs kevinAlbs marked this pull request as ready for review July 9, 2024 20:29
@kevinAlbs kevinAlbs requested a review from adriandole July 9, 2024 20:30
@kevinAlbs kevinAlbs merged commit 9f2467e into mongodb:master Jul 10, 2024
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