Skip to content

Commit

Permalink
Fix Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Peyton-McKee committed Jan 14, 2025
1 parent bd01681 commit 2201748
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion scylla-server/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
2 changes: 1 addition & 1 deletion scylla-server/tests/data_service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions scylla-server/tests/data_type_service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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?;
Expand Down
2 changes: 1 addition & 1 deletion scylla-server/tests/run_service_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");

Expand Down
6 changes: 4 additions & 2 deletions scylla-server/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Pool<AsyncPgConnection>, diesel::result::Error> {
dotenv().ok();
Expand All @@ -24,7 +24,9 @@ pub async fn cleanup_and_prepare() -> Result<Pool<AsyncPgConnection>, 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())
Expand Down

0 comments on commit 2201748

Please sign in to comment.