Skip to content

Commit

Permalink
WIP: test tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Nov 22, 2023
1 parent a6bb99f commit fcc3ece
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod occ {
assert_eq!(booked_user_id, found_booked_user_id);
}

#[connector_test(schema(occ_simple), exclude(MongoDB, CockroachDb))]
#[connector_test(schema(occ_simple), exclude(MongoDB, CockroachDb, Vitess("planetscale.js")))]
async fn occ_update_many_test(runner: Runner) -> TestResult<()> {
let runner = Arc::new(runner);

Expand All @@ -127,7 +127,7 @@ mod occ {
Ok(())
}

#[connector_test(schema(occ_simple), exclude(CockroachDb))]
#[connector_test(schema(occ_simple), exclude(CockroachDb, Vitess("planetscale.js")))]
async fn occ_update_test(runner: Runner) -> TestResult<()> {
let runner = Arc::new(runner);

Expand Down Expand Up @@ -158,7 +158,7 @@ mod occ {
Ok(())
}

#[connector_test(schema(occ_simple))]
#[connector_test(schema(occ_simple), exclude(Vitess("planetscale.js")))]
async fn occ_delete_test(runner: Runner) -> TestResult<()> {
let runner = Arc::new(runner);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use indoc::indoc;
use query_engine_tests::*;

#[test_suite(suite = "setdefault_onD_1to1_req", exclude(MongoDb, MySQL))]
#[test_suite(suite = "setdefault_onD_1to1_req", exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
mod one2one_req {
fn required_with_default() -> String {
let schema = indoc! {
Expand Down Expand Up @@ -66,7 +66,7 @@ mod one2one_req {
}

/// Deleting the parent reconnects the child to the default and fails (the default doesn't exist).
#[connector_test(schema(required_with_default), exclude(MongoDb, MySQL))]
#[connector_test(schema(required_with_default), exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
async fn delete_parent_no_exist_fail(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, child: { create: { id: 1 }}}) { id }}"#),
Expand Down Expand Up @@ -103,7 +103,7 @@ mod one2one_req {
}
}

#[test_suite(suite = "setdefault_onD_1to1_opt", exclude(MongoDb, MySQL))]
#[test_suite(suite = "setdefault_onD_1to1_opt", exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
mod one2one_opt {
fn optional_with_default() -> String {
let schema = indoc! {
Expand Down Expand Up @@ -167,7 +167,7 @@ mod one2one_opt {
}

/// Deleting the parent reconnects the child to the default and fails (the default doesn't exist).
#[connector_test(schema(optional_with_default), exclude(MongoDb, MySQL))]
#[connector_test(schema(optional_with_default), exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
async fn delete_parent_no_exist_fail(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, child: { create: { id: 1 }}}) { id }}"#),
Expand Down Expand Up @@ -206,7 +206,7 @@ mod one2one_opt {
}
}

#[test_suite(suite = "setdefault_onD_1toM_req", exclude(MongoDb, MySQL))]
#[test_suite(suite = "setdefault_onD_1toM_req", exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
mod one2many_req {
fn required_with_default() -> String {
let schema = indoc! {
Expand Down Expand Up @@ -270,7 +270,7 @@ mod one2many_req {
}

/// Deleting the parent reconnects the child to the default and fails (the default doesn't exist).
#[connector_test(schema(required_with_default), exclude(MongoDb, MySQL))]
#[connector_test(schema(required_with_default), exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
async fn delete_parent_no_exist_fail(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, children: { create: { id: 1 }}}) { id }}"#),
Expand Down Expand Up @@ -307,7 +307,7 @@ mod one2many_req {
}
}

#[test_suite(suite = "setdefault_onD_1toM_opt", exclude(MongoDb, MySQL))]
#[test_suite(suite = "setdefault_onD_1toM_opt", exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
mod one2many_opt {
fn optional_with_default() -> String {
let schema = indoc! {
Expand Down Expand Up @@ -344,7 +344,7 @@ mod one2many_opt {
}

/// Deleting the parent reconnects the child to the default.
#[connector_test(schema(optional_with_default))]
#[connector_test(schema(optional_with_default), exclude(Vitess("planetscale.js")))]
async fn delete_parent(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, children: { create: { id: 1 }}}) { id }}"#),
Expand All @@ -371,7 +371,7 @@ mod one2many_opt {
}

/// Deleting the parent reconnects the child to the default and fails (the default doesn't exist).
#[connector_test(schema(optional_with_default), exclude(MongoDb, MySQL))]
#[connector_test(schema(optional_with_default), exclude(MongoDb, MySQL, Vitess("planetscale.js")))]
async fn delete_parent_no_exist_fail(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, children: { create: { id: 1 }}}) { id }}"#),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod aggregation_avg {
Ok(())
}

#[connector_test(exclude(MongoDb))]
#[connector_test(exclude(MongoDb, Vitess("planetscale.js")))]
async fn avg_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, float: 5.5, int: 5, bInt: "5" }"#).await?;
create_row(&runner, r#"{ id: 2, float: 4.5, int: 10, bInt: "10" }"#).await?;
Expand Down Expand Up @@ -126,7 +126,7 @@ mod decimal_aggregation_avg {
Ok(())
}

#[connector_test(exclude(MongoDb))]
#[connector_test(exclude(MongoDb, Vitess("planetscale.js")))]
async fn avg_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, decimal: "5.5" }"#).await?;
create_row(&runner, r#"{ id: 2, decimal: "4.5" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ mod combinations {
}

// Mongo precision issue.
#[connector_test(exclude(MongoDB))]
#[connector_test(exclude(MongoDB, Vitess("planetscale.js")))]
async fn with_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: "1", float: 5.5, int: 5 }"#).await?;
create_row(&runner, r#"{ id: "2", float: 4.5, int: 10 }"#).await?;
Expand Down Expand Up @@ -369,7 +369,7 @@ mod decimal_combinations {
}

// Mongo precision issue.
#[connector_test(exclude(MongoDB))]
#[connector_test(exclude(MongoDB, Vitess("planetscale.js")))]
async fn with_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: "1", dec: "5.5" }"#).await?;
create_row(&runner, r#"{ id: "2", dec: "4.5" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod aggregation_count {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn count_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, string: "1" }"#).await?;
create_row(&runner, r#"{ id: 2, string: "2" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod aggregation_max {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn max_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, float: 5.5, int: 5, bInt: "5", string: "2" }"#).await?;
create_row(&runner, r#"{ id: 2, float: 4.5, int: 10, bInt: "10", string: "f" }"#).await?;
Expand Down Expand Up @@ -120,7 +120,7 @@ mod decimal_aggregation_max {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn max_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, decimal: "5.5" }"#).await?;
create_row(&runner, r#"{ id: 2, decimal: "4.5" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod aggregation_min {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn min_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, float: 5.5, int: 5, bInt: "5", string: "2" }"#).await?;
create_row(&runner, r#"{ id: 2, float: 4.5, int: 10, bInt: "10", string: "f" }"#).await?;
Expand Down Expand Up @@ -120,7 +120,7 @@ mod decimal_aggregation_min {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn min_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, decimal: "5.5" }"#).await?;
create_row(&runner, r#"{ id: 2, decimal: "4.5" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ mod aggregation_sum {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn sum_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, float: 5.5, int: 5, bInt: "5" }"#).await?;
create_row(&runner, r#"{ id: 2, float: 4.5, int: 10, bInt: "10" }"#).await?;
Expand Down Expand Up @@ -120,7 +120,7 @@ mod decimal_aggregation_sum {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn sum_with_all_sorts_of_query_args(runner: Runner) -> TestResult<()> {
create_row(&runner, r#"{ id: 1, decimal: "5.5" }"#).await?;
create_row(&runner, r#"{ id: 2, decimal: "4.5" }"#).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mod transactional {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn one_success_one_fail(runner: Runner) -> TestResult<()> {
let queries = vec![
r#"mutation { createOneModelA(data: { id: 1 }) { id }}"#.to_string(),
Expand Down Expand Up @@ -77,7 +77,7 @@ mod transactional {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn one_query(runner: Runner) -> TestResult<()> {
// Existing ModelA in the DB will prevent the nested ModelA creation in the batch.
insta::assert_snapshot!(
Expand All @@ -104,7 +104,7 @@ mod transactional {
Ok(())
}

#[connector_test(exclude(MongoDb))]
#[connector_test(exclude(MongoDb, Vitess("planetscale.js")))]
async fn valid_isolation_level(runner: Runner) -> TestResult<()> {
let queries = vec![r#"mutation { createOneModelB(data: { id: 1 }) { id }}"#.to_string()];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ mod json_filter {
Ok(())
}

#[connector_test(schema(schema))]
#[connector_test(schema(schema), exclude(Vitess("planetscale.js")))]
async fn string_comparison_filters(runner: Runner) -> TestResult<()> {
test_string_data(&runner).await?;

Expand Down Expand Up @@ -169,7 +169,7 @@ mod json_filter {
Ok(())
}

#[connector_test(schema(schema))]
#[connector_test(schema(schema), exclude(Vitess("planetscale.js")))]
async fn array_comparison_filters(runner: Runner) -> TestResult<()> {
test_array_data(&runner).await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ mod json_filters {
schema.to_owned()
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn no_path_without_filter(runner: Runner) -> TestResult<()> {
assert_error!(
runner,
Expand Down Expand Up @@ -262,7 +262,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn array_contains(runner: Runner) -> TestResult<()> {
array_contains_runner(runner).await?;

Expand Down Expand Up @@ -371,7 +371,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn array_starts_with(runner: Runner) -> TestResult<()> {
array_starts_with_runner(runner).await?;

Expand Down Expand Up @@ -478,7 +478,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn array_ends_with(runner: Runner) -> TestResult<()> {
array_ends_with_runner(runner).await?;

Expand Down Expand Up @@ -517,7 +517,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn string_contains(runner: Runner) -> TestResult<()> {
string_contains_runner(runner).await?;

Expand Down Expand Up @@ -557,7 +557,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn string_starts_with(runner: Runner) -> TestResult<()> {
string_starts_with_runner(runner).await?;

Expand Down Expand Up @@ -596,7 +596,7 @@ mod json_filters {
Ok(())
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn string_ends_with(runner: Runner) -> TestResult<()> {
string_ends_with_runner(runner).await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ mod search_filter_with_index {
super::ensure_filter_tree_shake_works(runner).await
}

#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn throws_error_on_missing_index(runner: Runner) -> TestResult<()> {
super::create_test_data(&runner).await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mod nested_pagination {
***************/

// should skip the first item
#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn mid_lvl_skip_1(runner: Runner) -> TestResult<()> {
create_test_data(&runner).await?;

Expand All @@ -102,7 +102,7 @@ mod nested_pagination {
}

// should "skip all items"
#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn mid_lvl_skip_3(runner: Runner) -> TestResult<()> {
create_test_data(&runner).await?;

Expand All @@ -124,7 +124,7 @@ mod nested_pagination {
}

// should "skip all items"
#[connector_test]
#[connector_test(exclude(Vitess("planetscale.js")))]
async fn mid_lvl_skip_4(runner: Runner) -> TestResult<()> {
create_test_data(&runner).await?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod casts {
//
// Bails with: ERROR: invalid input syntax for type integer: "42.51"
//
#[connector_test(only(Postgres), exclude(Postgres("neon.js")))]
#[connector_test(only(Postgres), exclude(Postgres("neon.js"), Postgres("pg.js")))]
async fn query_numeric_casts(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query_pretty!(&runner, fmt_query_raw(r#"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"connector": "sqlite",
"version": "3",
"version": "libsql.js",
"driver_adapter": "libsql",
"external_test_executor": "default"
}

0 comments on commit fcc3ece

Please sign in to comment.