Skip to content

Commit 5a64198

Browse files
Update the C++ smoketest to use latest (#4919)
# Description of Changes The update version tool sets the /templates/basic-cpp/spacetimedb/CMakeLists.txt but as we're in the middle of release this can block the smoketest. This PR changes it to dynamically change to the `latest` release to allow release night smoketests to work correctly. # API and ABI breaking changes N/A # Expected complexity level and risk 1 - Small smoketest change # Testing - [x] Ran the C++ quickstart smoketest locally - [x] Updated local template and tested with / without the change Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
1 parent 818e9b2 commit 5a64198

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

crates/smoketests/tests/smoketests/quickstart.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,31 @@ log = "0.4"
543543
let ts_bindings = workspace.join("crates/bindings-typescript");
544544
pnpm(&["install", ts_bindings.to_str().unwrap()], server_path)?;
545545
}
546+
"cpp" => {
547+
// Use the workspace bindings directly so release CI doesn't depend
548+
// on a Git tag that may not exist yet for the version under test.
549+
let cmake_lists = server_path.join("CMakeLists.txt");
550+
let bindings_path = workspace.join("crates/bindings-cpp");
551+
let bindings_path_str = bindings_path.display().to_string().replace('\\', "/");
552+
553+
let content = fs::read_to_string(&cmake_lists)?;
554+
let updated = content.replace(
555+
"set(SPACETIMEDB_CPP_DIR \"\" CACHE PATH \"Path to a local clone of SpacetimeDB C++ bindings (overrides FetchContent)\")",
556+
&format!(
557+
"set(SPACETIMEDB_CPP_DIR \"{}\" CACHE PATH \"Path to a local clone of SpacetimeDB C++ bindings (overrides FetchContent)\")",
558+
bindings_path_str
559+
),
560+
);
561+
562+
if content == updated {
563+
bail!(
564+
"Failed to configure C++ quickstart smoketest: could not find SPACETIMEDB_CPP_DIR in {}",
565+
cmake_lists.display()
566+
);
567+
}
568+
569+
fs::write(cmake_lists, updated)?;
570+
}
546571
_ => {}
547572
}
548573

0 commit comments

Comments
 (0)