Skip to content

Commit cb6b7e2

Browse files
authored
ci: clone proper repo for snapshot gen (#139)
Signed-off-by: tison <wander4096@gmail.com>
1 parent b941327 commit cb6b7e2

2 files changed

Lines changed: 12 additions & 18 deletions

File tree

datasketches/tests/countmin_serialization_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ fn assert_cpp_snapshot(
5353

5454
#[test]
5555
fn test_deserialize_cpp_empty_snapshot() {
56-
assert_cpp_snapshot("count_min-empty.bin", 9001, 1, 5, 0);
56+
assert_cpp_snapshot("count_min_empty_cpp.sk", 9001, 1, 5, 0);
5757
}
5858

5959
#[test]
6060
fn test_deserialize_cpp_non_empty_snapshot() {
61-
assert_cpp_snapshot("count_min-non-empty.bin", 9001, 3, 1024, 2850);
61+
assert_cpp_snapshot("count_min_non_empty_cpp.sk", 9001, 3, 1024, 2850);
6262
}
6363

6464
#[test]
6565
fn test_deserialize_cpp_snapshot_with_wrong_seed() {
66-
let path = serialization_test_data("cpp_generated_files", "count_min-non-empty.bin");
66+
let path = serialization_test_data("cpp_generated_files", "count_min_non_empty_cpp.sk");
6767
let bytes = fs::read(&path).unwrap();
6868

6969
let err = CountMinSketch::<u64>::deserialize_with_seed(&bytes, 9000).unwrap_err();

tools/generate_serialization_test_data.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def generate_java_files(workspace_dir, project_dir):
7171

7272
# 4. Clone repository
7373
repo_url = "https://github.com/apache/datasketches-java.git"
74-
branch = "9.0.0" # FIXME: temporarily use fixed branch until mvn issue is resolved
74+
branch = "9.0.0"
7575
run_command([
7676
"git", "clone",
7777
"--depth", "1",
@@ -133,21 +133,15 @@ def generate_cpp_files(workspace_dir, project_root):
133133

134134
# 4. Clone repository
135135
repo_url = "https://github.com/apache/datasketches-cpp.git"
136-
branch = "master"
137-
# Temporary e2e checkout for apache/datasketches-cpp#505. After that PR is
138-
# merged, pin this to the merged master commit and remove the extra fetch.
139-
commit = "af4436280bdab53e0063268e92ff29b3fdcb1b07"
140-
fetch_ref = "refs/pull/505/head"
136+
commit = "401423367055acdf7502e8ed3126730a08039d91"
141137
run_command([
142138
"git", "clone",
143139
"--depth", "1",
144-
"--branch", branch,
140+
"--revision", commit,
145141
"--single-branch",
146142
repo_url,
147143
str(temp_dir)
148144
])
149-
run_command(["git", "fetch", "--depth", "1", "origin", fetch_ref], cwd=temp_dir)
150-
run_command(["git", "checkout", "--detach", commit], cwd=temp_dir)
151145

152146
# 5. Build and Run CMake
153147
build_dir = temp_dir / "build"
@@ -173,14 +167,14 @@ def generate_cpp_files(workspace_dir, project_root):
173167

174168
files_copied = 0
175169

176-
for pattern in ("*_cpp.sk", "count_min-*.bin"):
177-
for file_path in build_dir.rglob(pattern):
178-
shutil.copy2(file_path, output_dir)
179-
print(f"Copied: {file_path.name}")
180-
files_copied += 1
170+
for file_path in build_dir.rglob("*_cpp.sk"):
171+
shutil.copy2(file_path, output_dir)
172+
print(f"Copied: {file_path.name}")
173+
files_copied += 1
174+
181175

182176
if files_copied == 0:
183-
print("Warning: No C++ serialization snapshots were found to copy.")
177+
print("Warning: No *_cpp.sk files were found to copy.")
184178
else:
185179
print(f"Successfully copied {files_copied} files.")
186180

0 commit comments

Comments
 (0)