Skip to content

Commit

Permalink
Split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed May 29, 2024
1 parent 10bb3c6 commit 6dda946
Showing 1 changed file with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,12 @@ mod test {
use crate::db::raw_query_builder::expectorate_query_contents;
use uuid::Uuid;

// This test is a bit of a "change detector", but it's here to help with
// debugging too. If you change this query, it can be useful to see exactly
// how the output SQL has been altered.
// These tests are a bit of a "change detector", but they're here to help
// with debugging too. If you change this query, it can be useful to see
// exactly how the output SQL has been altered.

#[tokio::test]
async fn expectorate_query() {
async fn expectorate_query_insert_storage() {
let id = Uuid::nil();
let project_id = Uuid::nil();
let disk_byte_diff = 2048.try_into().unwrap();
Expand All @@ -669,11 +670,17 @@ mod test {
project_id,
storage_type,
);

expectorate_query_contents(
&query,
"tests/output/virtual_provisioning_collection_update_insert_storage.sql",
).await;
}

#[tokio::test]
async fn expectorate_query_delete_storage() {
let id = Uuid::nil();
let project_id = Uuid::nil();
let disk_byte_diff = 2048.try_into().unwrap();

let query = VirtualProvisioningCollectionUpdate::new_delete_storage(
id,
Expand All @@ -685,7 +692,12 @@ mod test {
&query,
"tests/output/virtual_provisioning_collection_update_delete_storage.sql",
).await;
}

#[tokio::test]
async fn expectorate_query_insert_instance() {
let id = Uuid::nil();
let project_id = Uuid::nil();
let cpus_diff = 4;
let ram_diff = 2048.try_into().unwrap();

Expand All @@ -697,7 +709,14 @@ mod test {
&query,
"tests/output/virtual_provisioning_collection_update_insert_instance.sql",
).await;
}

#[tokio::test]
async fn expectorate_query_delete_instance() {
let id = Uuid::nil();
let project_id = Uuid::nil();
let cpus_diff = 4;
let ram_diff = 2048.try_into().unwrap();
let max_instance_gen = 0;

let query = VirtualProvisioningCollectionUpdate::new_delete_instance(
Expand Down

0 comments on commit 6dda946

Please sign in to comment.