From 22017484ebc59cd05fb53661d462d7831b87290d Mon Sep 17 00:00:00 2001 From: Peyton-McKee Date: Tue, 14 Jan 2025 17:07:02 -0500 Subject: [PATCH] Fix Tests --- scylla-server/integration_test.sh | 2 +- scylla-server/tests/data_service_test.rs | 2 +- scylla-server/tests/data_type_service_test.rs | 6 +++--- scylla-server/tests/run_service_test.rs | 2 +- scylla-server/tests/test_utils.rs | 6 ++++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/scylla-server/integration_test.sh b/scylla-server/integration_test.sh index 4e0eb4b2..612aa23e 100755 --- a/scylla-server/integration_test.sh +++ b/scylla-server/integration_test.sh @@ -10,7 +10,7 @@ docker rm -f odyssey-timescale 2>/dev/null || echo "No existing container to rem # Start a new odyssey-timescale container echo "Starting a new odyssey-timescale container..." -docker compose up -d odyssey-timescale || { echo "Failed to start odyssey-timescale"; exit 1; } +docker-compose up -d odyssey-timescale || { echo "Failed to start odyssey-timescale"; exit 1; } # Wait for the database to initialize echo "Waiting for the database to initialize..." diff --git a/scylla-server/tests/data_service_test.rs b/scylla-server/tests/data_service_test.rs index 62489836..a4d183c6 100644 --- a/scylla-server/tests/data_service_test.rs +++ b/scylla-server/tests/data_service_test.rs @@ -59,7 +59,7 @@ async fn test_data_add() -> Result<(), diesel::result::Error> { ClientData { values: vec![0f32], unit: "A".to_owned(), - run_id: run_data.id, + run_id: run_data.runId, name: TEST_KEYWORD.to_owned(), timestamp: chrono::DateTime::from_timestamp_millis(1000).unwrap(), node: "Irrelevant".to_string(), diff --git a/scylla-server/tests/data_type_service_test.rs b/scylla-server/tests/data_type_service_test.rs index b805b176..56c8a465 100644 --- a/scylla-server/tests/data_type_service_test.rs +++ b/scylla-server/tests/data_type_service_test.rs @@ -7,7 +7,7 @@ use diesel::{ }; use diesel_async::RunQueryDsl; use scylla_server::{ - models::DataType, schema::dataType, services::data_type_service, + models::DataType, schema::data_type, services::data_type_service, transformers::data_type_transformer::PublicDataType, }; use test_utils::cleanup_and_prepare; @@ -41,8 +41,8 @@ async fn test_datatype_create() -> Result<(), diesel::result::Error> { .await?; // fetch - let data = dataType::table - .filter(dataType::name.eq(data_type_name.clone())) + let data = data_type::table + .filter(data_type::name.eq(data_type_name.clone())) .select(DataType::as_select()) .get_result(&mut db) .await?; diff --git a/scylla-server/tests/run_service_test.rs b/scylla-server/tests/run_service_test.rs index 21a95d11..b0bc73ce 100644 --- a/scylla-server/tests/run_service_test.rs +++ b/scylla-server/tests/run_service_test.rs @@ -26,7 +26,7 @@ async fn test_get_run_by_id() -> Result<(), diesel::result::Error> { .await?; // get that run - let run = run_service::get_run_by_id(&mut db, run_c.id) + let run = run_service::get_run_by_id(&mut db, run_c.runId) .await? .expect("Run should exist was upserted "); diff --git a/scylla-server/tests/test_utils.rs b/scylla-server/tests/test_utils.rs index e1ac0430..767003a1 100644 --- a/scylla-server/tests/test_utils.rs +++ b/scylla-server/tests/test_utils.rs @@ -5,7 +5,7 @@ use diesel_async::{ AsyncPgConnection, RunQueryDsl, }; use dotenvy::dotenv; -use scylla_server::schema::{data, dataType, run}; +use scylla_server::schema::{data, data_type, run}; pub async fn cleanup_and_prepare() -> Result, diesel::result::Error> { dotenv().ok(); @@ -24,7 +24,9 @@ pub async fn cleanup_and_prepare() -> Result, diesel::re let mut client = pool.get().await.unwrap(); diesel::delete(data::table).execute(&mut client).await?; - diesel::delete(dataType::table).execute(&mut client).await?; + diesel::delete(data_type::table) + .execute(&mut client) + .await?; diesel::delete(run::table).execute(&mut client).await?; Ok(pool.clone())