Skip to content

Commit 24f199f

Browse files
Wrote config file for missing clickhouse unit test (tensorzero#2925)
Co-authored-by: Viraj Mehta <[email protected]>
1 parent fefa467 commit 24f199f

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

clients/rust/src/lib.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,13 +1314,10 @@ mod tests {
13141314
use tracing_test::traced_test;
13151315

13161316
#[tokio::test]
1317-
#[ignore] // TODO - set an environment variable, or create a new config with dummy credentials
13181317
async fn test_missing_clickhouse() {
13191318
// This config file requires ClickHouse, so it should fail if no ClickHouse URL is provided
13201319
let err = ClientBuilder::new(ClientBuilderMode::EmbeddedGateway {
1321-
config_file: Some(PathBuf::from(
1322-
"../../examples/haiku-hidden-preferences/config/tensorzero.toml",
1323-
)),
1320+
config_file: Some(PathBuf::from("tests/test_config.toml")),
13241321
clickhouse_url: None,
13251322
timeout: None,
13261323
verify_credentials: true,
@@ -1330,7 +1327,7 @@ mod tests {
13301327
.expect_err("ClientBuilder should have failed");
13311328
let err_msg = err.to_string();
13321329
assert!(
1333-
err.to_string().contains("Missing ClickHouse URL"),
1330+
err_msg.contains("Missing environment variable TENSORZERO_CLICKHOUSE_URL"),
13341331
"Bad error message: {err_msg}"
13351332
);
13361333
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You are a helpful assistant.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{ user_text }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Test configuration for testing ClickHouse requirement
2+
# This config explicitly enables observability, which requires ClickHouse
3+
4+
[gateway.observability]
5+
enabled = true
6+
7+
# Minimal function definition for a valid config
8+
[functions.test_function]
9+
type = "chat"
10+
11+
[functions.test_function.variants.test_variant]
12+
type = "chat_completion"
13+
model = "openai::gpt-4o-mini-2024-07-18"
14+
system_template = "templates/system_template.minijinja"
15+
user_template = "templates/user_template.minijinja"

0 commit comments

Comments
 (0)