This is an automated email from the ASF dual-hosted git repository.

tisonkun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git


The following commit(s) were added to refs/heads/main by this push:
     new 983abab  test: update TCK snapshots and archive layout (#292)
983abab is described below

commit 983ababf8b4919bdd798a98143c854522060356a
Author: tison <[email protected]>
AuthorDate: Mon Oct 5 14:59:45 2026 +0800

    test: update TCK snapshots and archive layout (#292)
---
 CONTRIBUTING.md                                    |  2 +-
 tests-integration/tests/serde_tests/frequencies.rs | 30 ++++++++++++++++++++++
 tests-integration/tests/serde_tests/req.rs         |  2 +-
 xtask/src/main.rs                                  |  7 ++---
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 889d68a..841f850 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -144,7 +144,7 @@ cargo install taplo-cli typos-cli hawkeye
 
 Serialization compatibility tests use snapshots from a pinned revision of 
[`apache/datasketches-tck`](https://github.com/apache/datasketches-tck).
 
-The `cargo x prepare-testdata` command downloads the TCK archive and 
synchronizes its snapshots into:
+The `cargo x prepare-testdata` command downloads the TCK archive and 
synchronizes `.sk` files from 
`serialization_test_data/<language>_generated_files` into:
 
 - `tests-integration/tests/serde_tests/cpp_generated_files`
 - `tests-integration/tests/serde_tests/go_generated_files`
diff --git a/tests-integration/tests/serde_tests/frequencies.rs 
b/tests-integration/tests/serde_tests/frequencies.rs
index 21f3228..31c25cb 100644
--- a/tests-integration/tests/serde_tests/frequencies.rs
+++ b/tests-integration/tests/serde_tests/frequencies.rs
@@ -159,6 +159,36 @@ fn test_items_purged_round_trip() {
     check_purged_round_trip(|item| item.to_string());
 }
 
+fn check_purged_compatibility<T: FrequentItemValue>(dir: &str, filename: &str) 
{
+    let bytes = fs::read(serialization_test_data(dir, filename)).unwrap();
+    let sketch = FrequentItemsSketch::<T>::deserialize(&bytes).unwrap();
+    assert!(!sketch.is_empty());
+    assert_eq!(sketch.num_active_items(), 0);
+    assert_eq!(sketch.total_weight(), 193);
+    assert_eq!(sketch.maximum_error(), 1);
+    assert_eq!(sketch.serialize(), bytes);
+}
+
+#[test]
+fn test_cpp_frequent_longs_purged() {
+    check_purged_compatibility::<i64>("cpp_generated_files", 
"frequent_long_purged_cpp.sk");
+}
+
+#[test]
+fn test_cpp_frequent_strings_purged() {
+    check_purged_compatibility::<String>("cpp_generated_files", 
"frequent_string_purged_cpp.sk");
+}
+
+#[test]
+fn test_java_frequent_longs_purged() {
+    check_purged_compatibility::<i64>("java_generated_files", 
"frequent_long_purged_java.sk");
+}
+
+#[test]
+fn test_java_frequent_strings_purged() {
+    check_purged_compatibility::<String>("java_generated_files", 
"frequent_string_purged_java.sk");
+}
+
 #[test]
 fn test_deserialize_rejects_zero_stream_weight() {
     let mut active_sketch = FrequentItemsSketch::<i64>::new(32).unwrap();
diff --git a/tests-integration/tests/serde_tests/req.rs 
b/tests-integration/tests/serde_tests/req.rs
index 397f894..d0a03e1 100644
--- a/tests-integration/tests/serde_tests/req.rs
+++ b/tests-integration/tests/serde_tests/req.rs
@@ -487,7 +487,7 @@ fn deserialize_rejects_oversized_compactor_num_items() {
 
 // ---------- Cross-language compatibility ----------
 //
-// Requires fixtures generated by `tools/generate_serialization_test_data.py`.
+// Requires fixtures downloaded by `cargo x prepare-testdata`.
 // If `tests/serde_tests/{cpp,java}_generated_files/` is missing, the
 // `serialization_test_data` helper panics with regeneration instructions.
 
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 5f6a8a0..9b3fb1f 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -316,7 +316,7 @@ impl CommandPrepareTestData {
     }
 
     fn prepare(self) -> Result<()> {
-        const REVISION: &str = "c0a180708c6e6433e4cba7fba091713eb8af3eaa";
+        const REVISION: &str = "8193bab45ca5da3b513ea43fb5793e7e5b4da548";
         let serde_tests =
             
Path::new(env!("CARGO_WORKSPACE_DIR")).join("tests-integration/tests/serde_tests");
         let archive_url =
@@ -341,8 +341,9 @@ impl CommandPrepareTestData {
 
         let mut targets = vec![];
         for language in self.languages() {
-            let source_directory = 
Path::new("serialization").join(language).join("snapshots");
-            let destination = 
serde_tests.join(format!("{language}_generated_files"));
+            let directory_name = format!("{language}_generated_files");
+            let source_directory = 
Path::new("serialization_test_data").join(&directory_name);
+            let destination = serde_tests.join(directory_name);
             if fs::exists(&destination)? {
                 println!(
                     "Removing existing {language} snapshots from {}",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to