diff --git a/.github/workflows/serde_compat.yml b/.github/workflows/serde_compat.yml index 81547ee7..38fd7739 100644 --- a/.github/workflows/serde_compat.yml +++ b/.github/workflows/serde_compat.yml @@ -17,16 +17,18 @@ jobs: uses: actions/checkout@v5 with: repository: apache/datasketches-java - path: java + path: datasketches-java - name: Setup Java uses: actions/setup-java@v5 with: java-version: '25' distribution: 'temurin' - name: Run Java - run: cd java && mvn test -P generate-java-files + run: cd datasketches-java && mvn test -P generate-java-files - name: Copy files - run: cp java/serialization_test_data/java_generated_files/*.sk java + run: | + mkdir -p serialization_test_data/java_generated_files + cp datasketches-java/serialization_test_data/java_generated_files/*.sk serialization_test_data/java_generated_files - name: Run cmake run: cd build && cmake .. -DSERDE_COMPAT=true - name: Build C++ unit tests diff --git a/.gitignore b/.gitignore index 1571229e..3d66d9dd 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,7 @@ _*/ !__init__.py docs -java +# Cross-language test data: sketch snapshots and the datasketches-java checkout used to generate them +serialization_test_data/ +datasketches-java/ +*.sk diff --git a/cpc/test/cpc_sketch_deserialize_from_java_test.cpp b/cpc/test/cpc_sketch_deserialize_from_java_test.cpp index 70027e37..90a72bf6 100644 --- a/cpc/test/cpc_sketch_deserialize_from_java_test.cpp +++ b/cpc/test/cpc_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("cpc sketch", "[serde_compat]") { const unsigned n_arr[] = {0, 100, 200, 2000, 20000}; diff --git a/fi/test/frequent_items_sketch_deserialize_from_java_test.cpp b/fi/test/frequent_items_sketch_deserialize_from_java_test.cpp index 221f6a62..c9917587 100644 --- a/fi/test/frequent_items_sketch_deserialize_from_java_test.cpp +++ b/fi/test/frequent_items_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("frequent longs", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/filters/test/bloom_filter_deserialize_from_java_test.cpp b/filters/test/bloom_filter_deserialize_from_java_test.cpp index 126bac0c..65b8dd92 100644 --- a/filters/test/bloom_filter_deserialize_from_java_test.cpp +++ b/filters/test/bloom_filter_deserialize_from_java_test.cpp @@ -25,8 +25,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("bloom_filter", "[serde_compat]") { const uint64_t n_arr[] = {0, 10000, 2000000, 30000000}; diff --git a/hll/test/hll_sketch_deserialize_from_java_test.cpp b/hll/test/hll_sketch_deserialize_from_java_test.cpp index 828af544..502d9716 100644 --- a/hll/test/hll_sketch_deserialize_from_java_test.cpp +++ b/hll/test/hll_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("hll4 sketch", "[serde_compat]") { const unsigned n_arr[] = {0, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/kll/test/kll_sketch_deserialize_from_java_test.cpp b/kll/test/kll_sketch_deserialize_from_java_test.cpp index 65efc3e5..d2902635 100644 --- a/kll/test/kll_sketch_deserialize_from_java_test.cpp +++ b/kll/test/kll_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("kll float", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/quantiles/test/quantiles_sketch_deserialize_from_java_test.cpp b/quantiles/test/quantiles_sketch_deserialize_from_java_test.cpp index 1123d8fd..fcd4215c 100644 --- a/quantiles/test/quantiles_sketch_deserialize_from_java_test.cpp +++ b/quantiles/test/quantiles_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("quantiles double", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/req/test/req_sketch_deserialize_from_java_test.cpp b/req/test/req_sketch_deserialize_from_java_test.cpp index f90d930f..1d43116f 100644 --- a/req/test/req_sketch_deserialize_from_java_test.cpp +++ b/req/test/req_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("req float", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/sampling/test/var_opt_sketch_deserialize_from_java_test.cpp b/sampling/test/var_opt_sketch_deserialize_from_java_test.cpp index e121eeeb..eb2e39cc 100644 --- a/sampling/test/var_opt_sketch_deserialize_from_java_test.cpp +++ b/sampling/test/var_opt_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("var opt sketch long", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/sampling/test/var_opt_union_deserialize_from_java_test.cpp b/sampling/test/var_opt_union_deserialize_from_java_test.cpp index 915f230f..f2148a4b 100644 --- a/sampling/test/var_opt_union_deserialize_from_java_test.cpp +++ b/sampling/test/var_opt_union_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("var opt union double", "[serde_compat]") { const double EPS = 1e-13; diff --git a/tdigest/test/tdigest_deserialize_from_java_test.cpp b/tdigest/test/tdigest_deserialize_from_java_test.cpp index 04e8f8c6..5725560c 100644 --- a/tdigest/test/tdigest_deserialize_from_java_test.cpp +++ b/tdigest/test/tdigest_deserialize_from_java_test.cpp @@ -25,8 +25,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("tdigest double", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/theta/test/theta_sketch_deserialize_from_java_test.cpp b/theta/test/theta_sketch_deserialize_from_java_test.cpp index 691320a4..8a590f87 100644 --- a/theta/test/theta_sketch_deserialize_from_java_test.cpp +++ b/theta/test/theta_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("theta sketch", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/tuple/test/aod_sketch_deserialize_from_java_test.cpp b/tuple/test/aod_sketch_deserialize_from_java_test.cpp index 5c0c0ce3..32ba10fc 100644 --- a/tuple/test/aod_sketch_deserialize_from_java_test.cpp +++ b/tuple/test/aod_sketch_deserialize_from_java_test.cpp @@ -25,8 +25,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("aod sketch one value", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000}; diff --git a/tuple/test/tuple_sketch_deserialize_from_java_test.cpp b/tuple/test/tuple_sketch_deserialize_from_java_test.cpp index 408223f9..7d295c72 100644 --- a/tuple/test/tuple_sketch_deserialize_from_java_test.cpp +++ b/tuple/test/tuple_sketch_deserialize_from_java_test.cpp @@ -24,8 +24,8 @@ namespace datasketches { // assume the binary sketches for this test have been generated by datasketches-java code -// in the subdirectory called "java" in the root directory of this project -static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../java/"; +// in the subdirectory "serialization_test_data/java_generated_files" in the root directory of this project +static std::string testBinaryInputPath = std::string(TEST_BINARY_INPUT_PATH) + "../../serialization_test_data/java_generated_files/"; TEST_CASE("tuple sketch int", "[serde_compat]") { const unsigned n_arr[] = {0, 1, 10, 100, 1000, 10000, 100000, 1000000};