diff --git a/.buildkite/engineer b/.buildkite/engineer index 71c1211a83b4..329a8cafa1d4 100755 --- a/.buildkite/engineer +++ b/.buildkite/engineer @@ -54,7 +54,7 @@ fi # Check if the system has engineer installed, if not, use a local copy. if ! type "engineer" &> /dev/null; then # Setup Prisma engine build & test tool (engineer). - curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.63/latest/$OS/engineer.gz" --output engineer.gz + curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.64/latest/$OS/engineer.gz" --output engineer.gz gzip -d engineer.gz chmod +x engineer diff --git a/.github/workflows/query-engine-driver-adapters.yml b/.github/workflows/query-engine-driver-adapters.yml index f6eec5ffc102..66fbbb46a508 100644 --- a/.github/workflows/query-engine-driver-adapters.yml +++ b/.github/workflows/query-engine-driver-adapters.yml @@ -25,21 +25,23 @@ jobs: fail-fast: false matrix: adapter: + - name: 'planetscale' + setup_task: 'dev-planetscale-js' - name: 'pg (napi)' - setup_task: 'dev-pg-postgres13' + setup_task: 'dev-pg-js' - name: 'neon:ws (napi)' - setup_task: 'dev-neon-ws-postgres13' + setup_task: 'dev-neon-js' - name: 'libsql (napi)' - setup_task: 'dev-libsql-sqlite' + setup_task: 'dev-libsql-js' # TODO: uncomment when WASM engine is functional # - name: 'pg (wasm)' - # setup_task: 'dev-pg-postgres13-wasm' + # setup_task: 'dev-pg-wasm' # needs_wasm_pack: true # - name: 'neon:ws (wasm)' - # setup_task: 'dev-neon-ws-postgres13-wasm' + # setup_task: 'dev-neon-wasm' # needs_wasm_pack: true # - name: 'libsql (wasm)' - # setup_task: 'dev-libsql-sqlite-wasm' + # setup_task: 'dev-libsql-wasm' # needs_wasm_pack: true node_version: ['18'] env: diff --git a/Makefile b/Makefile index 94b3d539f971..3aec261dc2f0 100644 --- a/Makefile +++ b/Makefile @@ -87,18 +87,18 @@ start-sqlite: dev-sqlite: cp $(CONFIG_PATH)/sqlite $(CONFIG_FILE) -dev-libsql-sqlite: build-qe-napi build-connector-kit-js - cp $(CONFIG_PATH)/libsql-sqlite $(CONFIG_FILE) +dev-libsql-js: build-qe-napi build-connector-kit-js + cp $(CONFIG_PATH)/libsql-js $(CONFIG_FILE) -test-libsql-sqlite: dev-libsql-sqlite test-qe-st +test-libsql-js: dev-libsql-js test-qe-st -test-driver-adapter-libsql: test-libsql-sqlite +test-driver-adapter-libsql: test-libsql-js -dev-libsql-sqlite-wasm: build-qe-wasm build-connector-kit-js - cp $(CONFIG_PATH)/libsql-sqlite-wasm $(CONFIG_FILE) +dev-libsql-wasm: build-qe-wasm build-connector-kit-js + cp $(CONFIG_PATH)/libsql-wasm $(CONFIG_FILE) -test-libsql-sqlite-wasm: dev-libsql-sqlite-wasm test-qe-st -test-driver-adapter-libsql-sqlite-wasm: test-libsql-sqlite-wasm +test-libsql-wasm: dev-libsql-wasm test-qe-st +test-driver-adapter-libsql-wasm: test-libsql-wasm start-postgres9: docker compose -f docker-compose.yml up --wait -d --remove-orphans postgres9 @@ -130,36 +130,36 @@ start-postgres13: dev-postgres13: start-postgres13 cp $(CONFIG_PATH)/postgres13 $(CONFIG_FILE) -start-pg-postgres13: start-postgres13 +start-pg-js: start-postgres13 -dev-pg-postgres13: start-pg-postgres13 build-qe-napi build-connector-kit-js - cp $(CONFIG_PATH)/pg-postgres13 $(CONFIG_FILE) +dev-pg-js: start-pg-js build-qe-napi build-connector-kit-js + cp $(CONFIG_PATH)/pg-js $(CONFIG_FILE) -test-pg-postgres13: dev-pg-postgres13 test-qe-st +test-pg-js: dev-pg-js test-qe-st -dev-pg-postgres13-wasm: start-pg-postgres13 build-qe-wasm build-connector-kit-js - cp $(CONFIG_PATH)/pg-postgres13-wasm $(CONFIG_FILE) +dev-pg-wasm: start-pg-js build-qe-wasm build-connector-kit-js + cp $(CONFIG_PATH)/pg-wasm $(CONFIG_FILE) -test-pg-postgres13-wasm: dev-pg-postgres13-wasm test-qe-st +test-pg-wasm: dev-pg-wasm test-qe-st -test-driver-adapter-pg: test-pg-postgres13 -test-driver-adapter-pg-wasm: test-pg-postgres13-wasm +test-driver-adapter-pg: test-pg-js +test-driver-adapter-pg-wasm: test-pg-wasm -start-neon-postgres13: - docker compose -f docker-compose.yml up --wait -d --remove-orphans neon-postgres13 +start-neon-js: + docker compose -f docker-compose.yml up --wait -d --remove-orphans neon-proxy -dev-neon-ws-postgres13: start-neon-postgres13 build-qe-napi build-connector-kit-js - cp $(CONFIG_PATH)/neon-ws-postgres13 $(CONFIG_FILE) +dev-neon-js: start-neon-js build-qe-napi build-connector-kit-js + cp $(CONFIG_PATH)/neon-js $(CONFIG_FILE) -test-neon-ws-postgres13: dev-neon-ws-postgres13 test-qe-st +test-neon-js: dev-neon-js test-qe-st -dev-neon-ws-postgres13-wasm: start-neon-postgres13 build-qe-wasm build-connector-kit-js - cp $(CONFIG_PATH)/neon-ws-postgres13-wasm $(CONFIG_FILE) +dev-neon-wasm: start-neon-js build-qe-wasm build-connector-kit-js + cp $(CONFIG_PATH)/neon-wasm $(CONFIG_FILE) -test-neon-ws-postgres13-wasm: dev-neon-ws-postgres13-wasm test-qe-st +test-neon-wasm: dev-neon-wasm test-qe-st -test-driver-adapter-neon: test-neon-ws-postgres13 -test-driver-adapter-neon-wasm: test-neon-ws-postgres13-wasm +test-driver-adapter-neon: test-neon-js +test-driver-adapter-neon-wasm: test-neon-wasm start-postgres14: docker compose -f docker-compose.yml up --wait -d --remove-orphans postgres14 @@ -283,21 +283,21 @@ start-vitess_8_0: dev-vitess_8_0: start-vitess_8_0 cp $(CONFIG_PATH)/vitess_8_0 $(CONFIG_FILE) -start-planetscale-vitess8: - docker compose -f docker-compose.yml up -d --remove-orphans planetscale-vitess8 +start-planetscale-js: + docker compose -f docker-compose.yml up -d --remove-orphans planetscale-proxy -dev-planetscale-vitess8: start-planetscale-vitess8 build-qe-napi build-connector-kit-js - cp $(CONFIG_PATH)/planetscale-vitess8 $(CONFIG_FILE) +dev-planetscale-js: start-planetscale-js build-qe-napi build-connector-kit-js + cp $(CONFIG_PATH)/planetscale-js $(CONFIG_FILE) -test-planetscale-vitess8: dev-planetscale-vitess8 test-qe-st +test-planetscale-js: dev-planetscale-js test-qe-st -dev-planetscale-vitess8-wasm: start-planetscale-vitess8 build-qe-wasm build-connector-kit-js - cp $(CONFIG_PATH)/planetscale-vitess8-wasm $(CONFIG_FILE) +dev-planetscale-wasm: start-planetscale-js build-qe-wasm build-connector-kit-js + cp $(CONFIG_PATH)/planetscale-wasm $(CONFIG_FILE) -test-planetscale-vitess8-wasm: dev-planetscale-vitess8-wasm test-qe-st +test-planetscale-wasm: dev-planetscale-wasm test-qe-st -test-driver-adapter-planetscale: test-planetscale-vitess8 -test-driver-adapter-planetscale-wasm: test-planetscale-vitess8-wasm +test-driver-adapter-planetscale: test-planetscale-js +test-driver-adapter-planetscale-wasm: test-planetscale-wasm ###################### # Local dev commands # diff --git a/docker-compose.yml b/docker-compose.yml index b8fe3e1e0fa0..9be5e6978f87 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: cockroach_23_1: - image: prismagraphql/cockroachdb-custom:23.1 + image: prismagraphql/cockroachdb-custom:23.1@sha256:c5a97355d56a7692ed34d835dfd8e3663d642219ea90736658a24840ea26862d restart: unless-stopped command: | start-single-node --insecure @@ -107,7 +107,7 @@ services: networks: - databases - neon-postgres13: + neon-proxy: image: ghcr.io/neondatabase/wsproxy:latest restart: unless-stopped environment: @@ -123,22 +123,69 @@ services: networks: - databases - planetscale-vitess8: + # Tests using a vitess backend were not running properly for query-engine tests, and In + # https://github.com/prisma/prisma-engines/pull/4423 work was done to have coverage of the correctness of planetscale + # driver adapters. + # + # Given these tests run against the planetscale proxy, and given a different test suite will exist for vitess with + # rust drivers, we opted for the path of least friction when running the driver adapter tests, which is putting a + # single mysql box behind the planetscale proxy instead of full vttest cluster. + # + # The tradeoffs are: + # + # - we don't exercise vitess but mysql. This is a close approximation, but there might be small differences in + # behavior. (ex. vttest can be returning different error messages than mysql) + # + # - however, we 1) do exercise the planetscale proxy, 2) we use relationMode=prisma and this resembles what actually + # happens within the query engine, where vitess does not exist as a provider, and as such there isn't any particular + # capability or conditional code making the engine behave differently then when using Mysql. + # In the end Vitess is just an abstraction existing in the test kit to a) use the mysql provider, b) run the suite + # with relationMode=prisma; c) being able to run or exclude specific tests for that configuration. But the existence + # of this testing connector is misleading, and it should probably be just a version of the MySQL testing connector + # instead. + planetscale-proxy: build: ./docker/planetscale_proxy environment: - MYSQL_HOST: 'vitess-test-8_0' - MYSQL_PORT: 33807 - MYSQL_DATABASE: 'test' + MYSQL_HOST: 'mysql-planetscale' + MYSQL_PORT: 3306 + MYSQL_DATABASE: prisma ports: - '8085:8085' depends_on: - - vitess-test-8_0 + mysql-planetscale: + condition: service_healthy restart: unless-stopped healthcheck: test: ['CMD', 'nc', '-z', '127.0.0.1', '8085'] interval: 5s timeout: 2s retries: 20 + networks: + - databases + + mysql-planetscale: + image: mysql:8.0.28 + command: mysqld + restart: unless-stopped + platform: linux/x86_64 + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: prisma + ports: + - '3310:3306' + networks: + - databases + tmpfs: /var/lib/planetscale-mysql + volumes: + - "./docker/planetscale-mysql/my.cnf:/etc/mysql/my.cnf" + ulimits: + nofile: + soft: 20000 + hard: 40000 + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + retries: 10 postgres14: image: postgres:14 @@ -180,6 +227,10 @@ services: networks: - databases tmpfs: /var/lib/mysql + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + retries: 10 mysql-5-7: image: mysql:5.7.44 @@ -194,6 +245,10 @@ services: networks: - databases tmpfs: /var/lib/mysql + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + retries: 10 mysql-8-0: image: mysql:8.0.28 @@ -208,6 +263,10 @@ services: networks: - databases tmpfs: /var/lib/mysql8 + healthcheck: + test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ] + timeout: 20s + retries: 10 mariadb-10-0: image: mariadb:10 diff --git a/docker/planetscale-mysql/my.cnf b/docker/planetscale-mysql/my.cnf new file mode 100644 index 000000000000..f47f808a75fb --- /dev/null +++ b/docker/planetscale-mysql/my.cnf @@ -0,0 +1,6 @@ +[mysqld] +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +datadir = /var/lib/mysql +secure-file-priv= NULL +max_connections=1000 \ No newline at end of file diff --git a/docker/planetscale_proxy/Dockerfile b/docker/planetscale_proxy/Dockerfile index 2411894d88f0..9d6cca2f5dd8 100644 --- a/docker/planetscale_proxy/Dockerfile +++ b/docker/planetscale_proxy/Dockerfile @@ -9,7 +9,7 @@ ENTRYPOINT /go/bin/ps-http-sim \ -http-port=8085 \ -mysql-addr=$MYSQL_HOST \ -mysql-port=$MYSQL_PORT \ - -mysql-idle-timeout=1200s \ + -mysql-idle-timeout=1s \ -mysql-no-pass \ -mysql-max-rows=1000 \ -mysql-dbname=$MYSQL_DATABASE diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/assertion_violation_error.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/assertion_violation_error.rs index a3e45b0a05b5..73455011d04e 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/assertion_violation_error.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/assertion_violation_error.rs @@ -2,7 +2,7 @@ use query_engine_tests::*; #[test_suite(schema(generic))] mod raw_params { - #[connector_test(only(Postgres), exclude(JS))] + #[connector_test(only(Postgres), exclude(Postgres("neon.js"), Postgres("pg.js")))] async fn value_too_many_bind_variables(runner: Runner) -> TestResult<()> { let n = 32768; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/interactive_tx.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/interactive_tx.rs index e45cef8ac306..33908a9e079e 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/interactive_tx.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/interactive_tx.rs @@ -1,7 +1,7 @@ use query_engine_tests::test_suite; use std::borrow::Cow; -#[test_suite(schema(generic))] +#[test_suite(schema(generic), exclude(Vitess("planetscale.js")))] mod interactive_tx { use query_engine_tests::*; use tokio::time; @@ -573,7 +573,7 @@ mod itx_isolation { use query_engine_tests::*; // All (SQL) connectors support serializable. - #[connector_test(exclude(MongoDb))] + #[connector_test(exclude(MongoDb, Vitess("planetscale.js")))] async fn basic_serializable(mut runner: Runner) -> TestResult<()> { let tx_id = runner.start_tx(5000, 5000, Some("Serializable".to_owned())).await?; runner.set_active_tx(tx_id.clone()); @@ -595,7 +595,7 @@ mod itx_isolation { Ok(()) } - #[connector_test(exclude(MongoDb))] + #[connector_test(exclude(MongoDb, Vitess("planetscale.js")))] async fn casing_doesnt_matter(mut runner: Runner) -> TestResult<()> { let tx_id = runner.start_tx(5000, 5000, Some("sErIaLiZaBlE".to_owned())).await?; runner.set_active_tx(tx_id.clone()); diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs index 77a56f46c34b..cd270bb334c6 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/metrics.rs @@ -1,6 +1,14 @@ use query_engine_tests::test_suite; -#[test_suite(schema(generic))] +#[test_suite( + schema(generic), + exclude( + Vitess("planetscale.js"), + Postgres("neon.js"), + Postgres("pg.js"), + Sqlite("libsql.js") + ) +)] mod metrics { use query_engine_metrics::{ PRISMA_CLIENT_QUERIES_ACTIVE, PRISMA_CLIENT_QUERIES_TOTAL, PRISMA_DATASOURCE_QUERIES_TOTAL, @@ -9,7 +17,7 @@ mod metrics { use query_engine_tests::*; use serde_json::Value; - #[connector_test(exclude(Js))] + #[connector_test] async fn metrics_are_recorded(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { createOneTestModel(data: { id: 1 }) { id }}"#), @@ -27,7 +35,7 @@ mod metrics { let total_operations = get_counter(&json, PRISMA_CLIENT_QUERIES_TOTAL); match runner.connector_version() { - Sqlite => assert_eq!(total_queries, 9), + Sqlite(_) => assert_eq!(total_queries, 9), SqlServer(_) => assert_eq!(total_queries, 17), MongoDb(_) => assert_eq!(total_queries, 5), CockroachDb(_) => (), // not deterministic @@ -40,7 +48,7 @@ mod metrics { Ok(()) } - #[connector_test(exclude(Js))] + #[connector_test] async fn metrics_tx_do_not_go_negative(mut runner: Runner) -> TestResult<()> { let tx_id = runner.start_tx(5000, 5000, None).await?; runner.set_active_tx(tx_id.clone()); diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/multi_schema.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/multi_schema.rs index 10d7c376b38e..db0f020e029c 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/multi_schema.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/multi_schema.rs @@ -1,6 +1,6 @@ use query_engine_tests::test_suite; -#[test_suite(capabilities(MultiSchema), exclude(Mysql))] +#[test_suite(capabilities(MultiSchema), exclude(Mysql, Vitess("planetscale.js")))] mod multi_schema { use query_engine_tests::*; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/occ.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/occ.rs index dc247f98f948..b495c8627e5a 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/occ.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/occ.rs @@ -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); @@ -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); @@ -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); diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs index 393581b8ad91..40ef54ed11f1 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_delete/set_default.rs @@ -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! { @@ -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 }}"#), @@ -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! { @@ -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 }}"#), @@ -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! { @@ -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 }}"#), @@ -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! { @@ -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 }}"#), diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs index 974c165ed942..b942d6f0bc7b 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/ref_actions/on_update/set_default.rs @@ -2,7 +2,7 @@ use indoc::indoc; use query_engine_tests::*; -#[test_suite(suite = "setdefault_onU_1to1_req", exclude(MongoDb, MySQL))] +#[test_suite(suite = "setdefault_onU_1to1_req", exclude(MongoDb, MySQL, Vitess))] mod one2one_req { fn required_with_default() -> String { let schema = indoc! { @@ -68,7 +68,7 @@ mod one2one_req { } /// Updating 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))] async fn update_parent_no_exist_fail(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, uniq: "1", child: { create: { id: 1 }}}) { id }}"#), @@ -105,7 +105,7 @@ mod one2one_req { } } -#[test_suite(suite = "setdefault_onU_1to1_opt", exclude(MongoDb, MySQL))] +#[test_suite(suite = "setdefault_onU_1to1_opt", exclude(MongoDb, MySQL, Vitess))] mod one2one_opt { fn optional_with_default() -> String { let schema = indoc! { @@ -171,7 +171,7 @@ mod one2one_opt { } /// Updating 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))] async fn update_parent_no_exist_fail(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, uniq: "1", child: { create: { id: 1 }}}) { id }}"#), @@ -210,7 +210,7 @@ mod one2one_opt { } } -#[test_suite(suite = "setdefault_onU_1toM_req", exclude(MongoDb, MySQL))] +#[test_suite(suite = "setdefault_onU_1toM_req", exclude(MongoDb, MySQL, Vitess))] mod one2many_req { fn required_with_default() -> String { let schema = indoc! { @@ -276,7 +276,7 @@ mod one2many_req { } /// Updating 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))] async fn update_parent_no_exist_fail(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, uniq: "1", children: { create: { id: 1 }}}) { id }}"#), @@ -313,7 +313,7 @@ mod one2many_req { } } -#[test_suite(suite = "setdefault_onU_1toM_opt", exclude(MongoDb, MySQL))] +#[test_suite(suite = "setdefault_onU_1toM_opt", exclude(MongoDb, MySQL, Vitess))] mod one2many_opt { fn optional_with_default() -> String { let schema = indoc! { @@ -379,7 +379,7 @@ mod one2many_opt { } /// Updating 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))] async fn update_parent_no_exist_fail(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { createOneParent(data: { id: 1, uniq: "1", children: { create: { id: 1 }}}) { id }}"#), diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/max_integer.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/max_integer.rs index 7b25cfff279e..78206f6394a6 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/max_integer.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/max_integer.rs @@ -187,7 +187,7 @@ mod max_integer { schema.to_owned() } - #[connector_test(schema(overflow_pg), only(Postgres), exclude(JS))] + #[connector_test(schema(overflow_pg), only(Postgres), exclude(Postgres("neon.js"), Postgres("pg.js")))] async fn unfitted_int_should_fail_pg_quaint(runner: Runner) -> TestResult<()> { // int assert_error!( @@ -235,7 +235,7 @@ mod max_integer { } // The driver adapter for neon provides different error messages on overflow - #[connector_test(schema(overflow_pg), only(JS, Postgres))] + #[connector_test(schema(overflow_pg), only(Postgres("neon.js"), Postgres("pg.js")))] async fn unfitted_int_should_fail_pg_js(runner: Runner) -> TestResult<()> { // int assert_error!( diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15204.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15204.rs index 179011108cb7..8582c14d0bc0 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15204.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_15204.rs @@ -24,7 +24,7 @@ mod conversion_error { schema.to_owned() } - #[connector_test(schema(schema_int), only(Sqlite), exclude(JS))] + #[connector_test(schema(schema_int), only(Sqlite), exclude(Sqlite("libsql.js")))] async fn convert_to_int_sqlite_quaint(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -38,7 +38,7 @@ mod conversion_error { Ok(()) } - #[connector_test(schema(schema_int), only(Sqlite, JS))] + #[connector_test(schema(schema_int), only(Sqlite("libsql.js")))] async fn convert_to_int_sqlite_js(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -52,7 +52,7 @@ mod conversion_error { Ok(()) } - #[connector_test(schema(schema_bigint), only(Sqlite), exclude(JS))] + #[connector_test(schema(schema_bigint), only(Sqlite), exclude(Sqlite("libsql.js")))] async fn convert_to_bigint_sqlite_quaint(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -66,7 +66,7 @@ mod conversion_error { Ok(()) } - #[connector_test(schema(schema_bigint), only(Sqlite, JS))] + #[connector_test(schema(schema_bigint), only(Sqlite("libsql.js")))] async fn convert_to_bigint_sqlite_js(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_17103.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_17103.rs index d82f7bd17bc4..c9065ec54c58 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_17103.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/new/regressions/prisma_17103.rs @@ -21,7 +21,7 @@ mod prisma_17103 { schema.to_owned() } - #[connector_test] + #[connector_test(exclude(Vitess("planetscale.js")))] async fn regression(runner: Runner) -> TestResult<()> { run_query!( &runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/avg.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/avg.rs index a155090c7d56..4793fa24ae2a 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/avg.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/avg.rs @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/combination_spec.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/combination_spec.rs index 46bdd77ddb58..3c1f1b092690 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/combination_spec.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/combination_spec.rs @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/count.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/count.rs index 3d5572650c13..78ab88fd59c6 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/count.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/count.rs @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/max.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/max.rs index d4ef72ee3cf6..12f9b6861892 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/max.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/max.rs @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/min.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/min.rs index 1927beba7ea5..332a5e10707f 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/min.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/min.rs @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/sum.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/sum.rs index 59a89cdff930..14d194a1a4f4 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/sum.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/aggregation/sum.rs @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/transactional_batch.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/transactional_batch.rs index 8c6e24db67ea..2c332f95f29a 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/transactional_batch.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/batch/transactional_batch.rs @@ -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(), @@ -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!( @@ -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()]; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/field_reference/json_filter.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/field_reference/json_filter.rs index 1fe86702ef5b..b865731161c2 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/field_reference/json_filter.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/field_reference/json_filter.rs @@ -126,7 +126,7 @@ mod json_filter { Ok(()) } - #[connector_test(schema(schema))] + #[connector_test(schema(schema), exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn string_comparison_filters(runner: Runner) -> TestResult<()> { test_string_data(&runner).await?; @@ -169,7 +169,7 @@ mod json_filter { Ok(()) } - #[connector_test(schema(schema))] + #[connector_test(schema(schema), exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn array_comparison_filters(runner: Runner) -> TestResult<()> { test_array_data(&runner).await?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json.rs index 2b4b880b4975..d1b62a086153 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json.rs @@ -209,7 +209,16 @@ mod json { // The external runner for driver adapters, in spite of the protocol being used in the test matrix // uses the JSON representation of queries, so this test should not apply to driver adapters (exclude(JS)) - #[connector_test(schema(json_opt), exclude(JS, MySQL(5.6)))] + #[connector_test( + schema(json_opt), + exclude( + Vitess("planetscale.js"), + Postgres("neon.js"), + Postgres("pg.js"), + Sqlite("libsql.js"), + MySQL(5.6) + ) + )] async fn nested_not_shorthand(runner: Runner) -> TestResult<()> { // Those tests pass with the JSON protocol because the entire object is parsed as JSON. // They remain useful to ensure we don't ever allow a full JSON filter input object type at the schema level. diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json_filters.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json_filters.rs index a30808902c1d..e2ab83cfd62f 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json_filters.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/json_filters.rs @@ -27,7 +27,7 @@ mod json_filters { schema.to_owned() } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn no_path_without_filter(runner: Runner) -> TestResult<()> { assert_error!( runner, @@ -262,7 +262,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn array_contains(runner: Runner) -> TestResult<()> { array_contains_runner(runner).await?; @@ -371,7 +371,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn array_starts_with(runner: Runner) -> TestResult<()> { array_starts_with_runner(runner).await?; @@ -478,7 +478,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn array_ends_with(runner: Runner) -> TestResult<()> { array_ends_with_runner(runner).await?; @@ -517,7 +517,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn string_contains(runner: Runner) -> TestResult<()> { string_contains_runner(runner).await?; @@ -557,7 +557,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn string_starts_with(runner: Runner) -> TestResult<()> { string_starts_with_runner(runner).await?; @@ -596,7 +596,7 @@ mod json_filters { Ok(()) } - #[connector_test] + #[connector_test(exclude(MySQL(5.6), Vitess("planetscale.js")))] async fn string_ends_with(runner: Runner) -> TestResult<()> { string_ends_with_runner(runner).await?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/search_filter.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/search_filter.rs index 218ecb7eb877..51637d3bbcb8 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/search_filter.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/filters/search_filter.rs @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/nested_pagination.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/nested_pagination.rs index 5337806756ed..27c04241288c 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/nested_pagination.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/nested_pagination.rs @@ -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?; @@ -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?; @@ -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?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent.rs index 357051280efc..b4c6e7b5ef34 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent.rs @@ -158,7 +158,7 @@ mod order_by_dependent { } }"#, // Depends on how null values are handled. - MongoDb(_) | Sqlite => vec![r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":null}},{"id":3,"b":null},{"id":1,"b":{"c":{"id":1}}}]}}"#], + MongoDb(_) | Sqlite(_) => vec![r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":null}},{"id":3,"b":null},{"id":1,"b":{"c":{"id":1}}}]}}"#], SqlServer(_) => vec![r#"{"data":{"findManyModelA":[{"id":3,"b":null},{"id":2,"b":{"c":null}},{"id":1,"b":{"c":{"id":1}}}]}}"#], Postgres(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"id":1}}},{"id":2,"b":{"c":null}},{"id":3,"b":null}]}}"#], _ => vec![ @@ -223,7 +223,7 @@ mod order_by_dependent { } // "[Circular with differing records] Ordering by related record field ascending" should "work" - #[connector_test(exclude(SqlServer))] + #[connector_test(exclude(SqlServer, Vitess("planetscale.js")))] async fn circular_diff_related_record_asc(runner: Runner) -> TestResult<()> { // Records form circles with their relations create_row(&runner, 1, Some(1), Some(1), Some(3)).await?; @@ -243,7 +243,7 @@ mod order_by_dependent { } } }"#, - MongoDb(_) | Sqlite => vec![r#"{"data":{"findManyModelA":[{"id":3,"b":null},{"id":4,"b":null},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#], + MongoDb(_) | Sqlite(_) => vec![r#"{"data":{"findManyModelA":[{"id":3,"b":null},{"id":4,"b":null},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#], MySql(_) | CockroachDb(_) => vec![ r#"{"data":{"findManyModelA":[{"id":4,"b":null},{"id":3,"b":null},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#, r#"{"data":{"findManyModelA":[{"id":3,"b":null},{"id":4,"b":null},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#, @@ -255,7 +255,7 @@ mod order_by_dependent { } // "[Circular with differing records] Ordering by related record field descending" should "work" - #[connector_test(exclude(SqlServer))] + #[connector_test(exclude(SqlServer, Vitess("planetscale.js")))] async fn circular_diff_related_record_desc(runner: Runner) -> TestResult<()> { // Records form circles with their relations create_row(&runner, 1, Some(1), Some(1), Some(3)).await?; @@ -275,7 +275,7 @@ mod order_by_dependent { } } }"#, - MongoDb(_) | Sqlite => vec![r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":{"a":{"id":4}}}},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":3,"b":null},{"id":4,"b":null}]}}"#], + MongoDb(_) | Sqlite(_)=> vec![r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":{"a":{"id":4}}}},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":3,"b":null},{"id":4,"b":null}]}}"#], MySql(_) | CockroachDb(_) => vec![ r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":{"a":{"id":4}}}},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":4,"b":null},{"id":3,"b":null}]}}"#, r#"{"data":{"findManyModelA":[{"id":2,"b":{"c":{"a":{"id":4}}}},{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":3,"b":null},{"id":4,"b":null}]}}"#, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent_pagination.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent_pagination.rs index ab0820ef0a35..f8e5e831971b 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent_pagination.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/order_by_dependent_pagination.rs @@ -79,7 +79,7 @@ mod order_by_dependent_pag { // "[Hops: 1] Ordering by related record field ascending with nulls" should "work" // TODO(julius): should enable for SQL Server when partial indices are in the PSL - #[connector_test(exclude(SqlServer))] + #[connector_test(exclude(SqlServer, Vitess("planetscale.js")))] async fn hop_1_related_record_asc_nulls(runner: Runner) -> TestResult<()> { // 1 record has the "full chain", one half, one none create_row(&runner, 1, Some(1), Some(1), None).await?; @@ -97,7 +97,7 @@ mod order_by_dependent_pag { } }"#, // Depends on how null values are handled. - MongoDb(_) | Sqlite | MySql(_) | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"id":1}},{"id":2,"b":{"id":2}}]}}"#], + MongoDb(_) | Sqlite(_) | MySql(_) | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"id":1}},{"id":2,"b":{"id":2}}]}}"#], _ => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"id":1}},{"id":2,"b":{"id":2}},{"id":3,"b":null}]}}"#] ); @@ -146,7 +146,7 @@ mod order_by_dependent_pag { // "[Hops: 2] Ordering by related record field ascending with nulls" should "work" // TODO(garren): should enable for SQL Server when partial indices are in the PSL - #[connector_test(exclude(SqlServer))] + #[connector_test(exclude(SqlServer, Vitess("planetscale.js")))] async fn hop_2_related_record_asc_null(runner: Runner) -> TestResult<()> { // 1 record has the "full chain", one half, one none create_row(&runner, 1, Some(1), Some(1), None).await?; @@ -166,7 +166,7 @@ mod order_by_dependent_pag { } }"#, // Depends on how null values are handled. - MongoDb(_) | Sqlite | MySql(_) | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"id":1}}}]}}"#], + MongoDb(_) | Sqlite(_) | MySql(_) | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"id":1}}}]}}"#], _ => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"id":1}}},{"id":2,"b":{"c":null}},{"id":3,"b":null}]}}"#] ); @@ -227,7 +227,7 @@ mod order_by_dependent_pag { // "[Circular with differing records] Ordering by related record field ascending" should "work" // TODO(julius): should enable for SQL Server when partial indices are in the PSL - #[connector_test(exclude(SqlServer))] + #[connector_test(exclude(SqlServer, Vitess("planetscale.js")))] async fn circular_diff_related_record_asc(runner: Runner) -> TestResult<()> { // Records form circles with their relations create_row(&runner, 1, Some(1), Some(1), Some(3)).await?; @@ -248,7 +248,7 @@ mod order_by_dependent_pag { } }"#, // Depends on how null values are handled. - MongoDb(_) | MySql(_) | Sqlite | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#], + MongoDb(_) | MySql(_) | Sqlite(_) | CockroachDb(_) => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}}]}}"#], _ => vec![r#"{"data":{"findManyModelA":[{"id":1,"b":{"c":{"a":{"id":3}}}},{"id":2,"b":{"c":{"a":{"id":4}}}},{"id":3,"b":null},{"id":4,"b":null}]}}"#] ); diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/pagination.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/pagination.rs index f0874cae02c8..83c472a064e7 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/pagination.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/order_and_pagination/pagination.rs @@ -277,7 +277,7 @@ mod pagination { ********************/ // "A skip" should "return all records after the offset specified" - #[connector_test] + #[connector_test(exclude(Vitess("planetscale.js")))] async fn skip_returns_all_after_offset(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -296,7 +296,7 @@ mod pagination { } // "A skip with order reversed" should "return all records after the offset specified" - #[connector_test] + #[connector_test(exclude(Vitess("planetscale.js")))] async fn skip_reversed_order(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; @@ -315,7 +315,7 @@ mod pagination { } // "A skipping beyond all records" should "return no records" - #[connector_test] + #[connector_test(exclude(Vitess("planetscale.js")))] async fn skipping_beyond_all_records(runner: Runner) -> TestResult<()> { create_test_data(&runner).await?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/simple/multi_field_unique.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/simple/multi_field_unique.rs index fea6cfba0078..cb691971132d 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/simple/multi_field_unique.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/simple/multi_field_unique.rs @@ -176,7 +176,7 @@ mod multi_field_unique { schema.to_owned() } - #[connector_test(schema(many_unique_fields), exclude(MySQL))] + #[connector_test(schema(many_unique_fields), exclude(MySQL, Vitess))] async fn ludicrous_fields(runner: Runner) -> TestResult<()> { create_user( &runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/views.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/views.rs index 4177f4d3a07d..feab8a87f2fe 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/views.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/queries/views.rs @@ -2,7 +2,7 @@ use query_engine_tests::*; // https://stackoverflow.com/questions/4380813/how-to-get-rid-of-mysql-error-prepared-statement-needs-to-be-re-prepared // Looks like there's a bug with create view stmt on MariaDB -#[test_suite(schema(schema), exclude(MongoDb, MySql("mariadb")))] +#[test_suite(schema(schema), exclude(MongoDb, MySQL("mariadb"), Vitess))] mod views { use query_engine_tests::{connector_test, run_query, Runner}; @@ -146,7 +146,7 @@ mod views { => { r#"CREATE VIEW TestView AS SELECT TestModel.*, CONCAT(TestModel.firstName, ' ', TestModel.lastName) AS "fullName" FROM TestModel"#.to_owned() }, - ConnectorVersion::Sqlite => { + ConnectorVersion::Sqlite(_) => { r#"CREATE VIEW TestView AS SELECT TestModel.*, TestModel.firstName || ' ' || TestModel.lastName AS "fullName" FROM TestModel"#.to_owned() } ConnectorVersion::SqlServer(_) => { diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/casts.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/casts.rs index 635726c71380..c03067eed818 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/casts.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/casts.rs @@ -18,7 +18,7 @@ mod casts { // // Bails with: ERROR: invalid input syntax for type integer: "42.51" // - #[connector_test(only(Postgres), exclude(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#" diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/errors.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/errors.rs index 43417cb352e9..cb44a2285ff2 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/errors.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/raw/sql/errors.rs @@ -34,7 +34,11 @@ mod raw_errors { Ok(()) } - #[connector_test(schema(common_nullable_types), only(Postgres), exclude(JS))] + #[connector_test( + schema(common_nullable_types), + only(Postgres), + exclude(Postgres("neon.js"), Postgres("pg.js")) + )] async fn list_param_for_scalar_column_should_not_panic_quaint(runner: Runner) -> TestResult<()> { assert_error!( runner, @@ -49,7 +53,7 @@ mod raw_errors { Ok(()) } - #[connector_test(schema(common_nullable_types), only(JS, Postgres))] + #[connector_test(schema(common_nullable_types), only(Postgres("neon.js"), Postgres("pg.js")))] async fn list_param_for_scalar_column_should_not_panic_pg_js(runner: Runner) -> TestResult<()> { assert_error!( runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/bytes.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/bytes.rs index a89bafd4c7ed..791b0a2137fb 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/bytes.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/bytes.rs @@ -77,7 +77,7 @@ mod bytes { Ok(()) } - #[connector_test(schema(bytes_id), exclude(MySQL, SqlServer))] + #[connector_test(schema(bytes_id), exclude(MySQL, Vitess, SqlServer))] async fn byte_id_coercion(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(runner, r#" diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/json.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/json.rs index e34604815a7b..609607e22f1f 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/json.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/data_types/json.rs @@ -17,7 +17,7 @@ mod json { } // "Json float accuracy" should "work" - #[connector_test(exclude(SqlServer, Mysql, Sqlite))] + #[connector_test(exclude(SqlServer, MySQL, Vitess, Sqlite))] async fn json_float_accuracy(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/ids/byoid.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/ids/byoid.rs index 66ca6defd4e9..5493ff7f2778 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/ids/byoid.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/ids/byoid.rs @@ -45,7 +45,11 @@ mod byoid { } // "A Create Mutation" should "create and return item with own Id" - #[connector_test(schema(schema_1))] + #[connector_test( + schema(schema_1), + only(MySql, Postgres, Sqlite, Vitess), + exclude(Vitess("planetscale.js")) + )] async fn create_and_return_item_woi_1(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { @@ -73,7 +77,11 @@ mod byoid { } // "A Create Mutation" should "create and return item with own Id" - #[connector_test(schema(schema_2))] + #[connector_test( + schema(schema_2), + only(MySql, Postgres, Sqlite, Vitess), + exclude(Vitess("planetscale.js")) + )] async fn create_and_return_item_woi_2(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { @@ -131,7 +139,11 @@ mod byoid { } // "A Nested Create Mutation" should "create and return item with own Id" - #[connector_test(schema(schema_1))] + #[connector_test( + schema(schema_1), + only(MySql, Postgres, Sqlite, Vitess), + exclude(Vitess("planetscale.js")) + )] async fn nested_create_return_item_woi_1(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { @@ -159,7 +171,11 @@ mod byoid { } // "A Nested Create Mutation" should "create and return item with own Id" - #[connector_test(schema(schema_2))] + #[connector_test( + schema(schema_2), + only(MySql, Postgres, Sqlite, Vitess), + exclude(Vitess("planetscale.js")) + )] async fn nested_create_return_item_woi_2(runner: Runner) -> TestResult<()> { insta::assert_snapshot!( run_query!(&runner, r#"mutation { diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/nested_mutations/not_using_schema_base/nested_create_many.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/nested_mutations/not_using_schema_base/nested_create_many.rs index 3cd6be2eabe2..45562b5f6be8 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/nested_mutations/not_using_schema_base/nested_create_many.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/nested_mutations/not_using_schema_base/nested_create_many.rs @@ -78,7 +78,7 @@ mod nested_create_many { // "Nested createMany" should "error on duplicates by default" // TODO(dom): Not working for mongo - #[connector_test(exclude(Sqlite, MongoDb))] + #[connector_test(exclude(Sqlite, MongoDb, Vitess("planetscale.js")))] async fn nested_createmany_fail_dups(runner: Runner) -> TestResult<()> { assert_error!( &runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/relations/compound_fks_mixed_requiredness.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/relations/compound_fks_mixed_requiredness.rs index 2ed763a1f123..808af82deec4 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/relations/compound_fks_mixed_requiredness.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/relations/compound_fks_mixed_requiredness.rs @@ -26,7 +26,7 @@ mod compound_fks { } // "A One to Many relation with mixed requiredness" should "be writable and readable" - #[connector_test(exclude(MySql(5.6), MongoDb))] + #[connector_test(exclude(MySql(5.6), MongoDb, Vitess("planetscale.js")))] async fn one2m_mix_required_writable_readable(runner: Runner) -> TestResult<()> { // Setup user insta::assert_snapshot!( diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create.rs index 1247b3e27bea..1507ea0c082b 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create.rs @@ -205,7 +205,7 @@ mod create { // TODO(dom): Not working on mongo // TODO(dom): 'Expected result to return an error, but found success: {"data":{"createOneScalarModel":{"optUnique":"test"}}}' // Comment(dom): Expected, we're not enforcing uniqueness for the test setup yet. - #[connector_test(exclude(MongoDb))] + #[connector_test(exclude(MongoDb, Vitess("planetscale.js")))] async fn gracefully_fails_when_uniq_violation(runner: Runner) -> TestResult<()> { run_query!( &runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many.rs index 35a044b1473d..94118b669c1b 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many.rs @@ -165,7 +165,7 @@ mod create_many { } // "createMany" should "error on duplicates by default" - #[connector_test(schema(schema_4))] + #[connector_test(schema(schema_4), exclude(Vitess("planetscale.js")))] async fn create_many_error_dups(runner: Runner) -> TestResult<()> { assert_error!( &runner, diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/update_many.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/update_many.rs index 7e969e21cdce..749048fd3edc 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/update_many.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/update_many.rs @@ -123,7 +123,7 @@ mod update_many { } // "An updateMany mutation" should "correctly apply all number operations for Int" - #[connector_test(exclude(CockroachDb))] + #[connector_test(exclude(Vitess("planetscale.js"), CockroachDb))] async fn apply_number_ops_for_int(runner: Runner) -> TestResult<()> { create_row(&runner, r#"{ id: 1, optStr: "str1" }"#).await?; create_row(&runner, r#"{ id: 2, optStr: "str2", optInt: 2 }"#).await?; @@ -240,7 +240,7 @@ mod update_many { } // "An updateMany mutation" should "correctly apply all number operations for Float" - #[connector_test] + #[connector_test(exclude(Vitess("planetscale.js")))] async fn apply_number_ops_for_float(runner: Runner) -> TestResult<()> { create_row(&runner, r#"{ id: 1, optStr: "str1" }"#).await?; create_row(&runner, r#"{ id: 2, optStr: "str2", optFloat: 2 }"#).await?; diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/upsert.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/upsert.rs index 2b3dee14f8e7..f4f43eda05ac 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/upsert.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/upsert.rs @@ -674,7 +674,7 @@ mod upsert { Ok(()) } - #[connector_test(schema(generic))] + #[connector_test(schema(generic), exclude(Vitess("planetscale.js")))] async fn upsert_fails_if_filter_dont_match(runner: Runner) -> TestResult<()> { run_query!( &runner, diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs index 07ceca784ff9..49ca5440a25c 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/config.rs @@ -2,7 +2,7 @@ use crate::{ CockroachDbConnectorTag, ConnectorTag, ConnectorVersion, MongoDbConnectorTag, MySqlConnectorTag, PostgresConnectorTag, SqlServerConnectorTag, SqliteConnectorTag, TestResult, VitessConnectorTag, }; -use serde::Deserialize; +use serde::{Deserialize, Serialize}; use std::{convert::TryFrom, env, fmt::Display, fs::File, io::Read, path::PathBuf}; static TEST_CONFIG_FILE_NAME: &str = ".test_config"; @@ -27,13 +27,13 @@ impl Display for TestExecutor { pub struct TestConfig { /// The connector that tests should run for. /// Env key: `TEST_CONNECTOR` - connector: String, + pub(crate) connector: String, /// The connector version tests should run for. /// If the test connector is versioned, this option is required. /// Env key: `TEST_CONNECTOR_VERSION` #[serde(rename = "version")] - connector_version: Option, + pub(crate) connector_version: Option, /// An external process to execute the test queries and produced responses for assertion /// Used when testing driver adapters, this process is expected to be a javascript process @@ -41,20 +41,25 @@ pub struct TestConfig { /// driver adapter. /// Possible values: Napi, Wasm /// Env key: `EXTERNAL_TEST_EXECUTOR` - external_test_executor: Option, + pub(crate) external_test_executor: Option, /// The driver adapter to use when running tests, will be forwarded to the external test /// executor by setting the `DRIVER_ADAPTER` env var when spawning the executor process - driver_adapter: Option, + pub(crate) driver_adapter: Option, /// The driver adapter configuration to forward as a stringified JSON object to the external /// test executor by setting the `DRIVER_ADAPTER_CONFIG` env var when spawning the executor - driver_adapter_config: Option, + pub(crate) driver_adapter_config: Option, /// Indicates whether or not the tests are running in CI context. /// Env key: `BUILDKITE` #[serde(default)] - is_ci: bool, + pub(crate) is_ci: bool, +} + +#[derive(Debug, Default, Serialize, Deserialize)] +pub(crate) struct DriverAdapterConfig { + pub(crate) proxy_url: Option, } const CONFIG_LOAD_FAILED: &str = r####" @@ -125,7 +130,7 @@ impl TestConfig { if let Some(external_test_executor) = self.external_test_executor.as_ref() { println!("* External test executor: {}", external_test_executor); println!("* Driver adapter: {}", self.driver_adapter().unwrap_or_default()); - println!("* Driver adapter url override: {}", self.json_stringify_driver_adapter_config()); + println!("* Driver adapter config: {}", self.json_stringify_driver_adapter_config()); } println!("******************************"); } @@ -139,7 +144,7 @@ impl TestConfig { let driver_adapter = std::env::var("DRIVER_ADAPTER").ok(); let driver_adapter_config = std::env::var("DRIVER_ADAPTER_CONFIG") - .map(|config| serde_json::from_str::(config.as_str()).ok()) + .map(|config| serde_json::from_str::(config.as_str()).ok()) .unwrap_or_default(); // Just care for a set value for now. @@ -204,7 +209,8 @@ impl TestConfig { | Ok(ConnectorVersion::SqlServer(None)) | Ok(ConnectorVersion::MongoDb(None)) | Ok(ConnectorVersion::CockroachDb(None)) - | Ok(ConnectorVersion::Postgres(None)) => { + | Ok(ConnectorVersion::Postgres(None)) + | Ok(ConnectorVersion::Sqlite(None)) => { exit_with_message("The current test connector requires a version to be set to run."); } Ok(ConnectorVersion::Vitess(Some(_))) @@ -213,7 +219,7 @@ impl TestConfig { | Ok(ConnectorVersion::MongoDb(Some(_))) | Ok(ConnectorVersion::CockroachDb(Some(_))) | Ok(ConnectorVersion::Postgres(Some(_))) - | Ok(ConnectorVersion::Sqlite) => (), + | Ok(ConnectorVersion::Sqlite(Some(_))) => (), Err(err) => exit_with_message(&err.to_string()), } @@ -278,11 +284,8 @@ impl TestConfig { self.driver_adapter.as_deref() } - pub fn json_stringify_driver_adapter_config(&self) -> String { - self.driver_adapter_config - .as_ref() - .map(|value| value.to_string()) - .unwrap_or("{}".to_string()) + fn json_stringify_driver_adapter_config(&self) -> String { + serde_json::to_string(&self.driver_adapter_config).unwrap_or_default() } pub fn test_connector(&self) -> TestResult<(ConnectorTag, ConnectorVersion)> { @@ -292,7 +295,7 @@ impl TestConfig { ConnectorVersion::Postgres(_) => &PostgresConnectorTag, ConnectorVersion::MySql(_) => &MySqlConnectorTag, ConnectorVersion::MongoDb(_) => &MongoDbConnectorTag, - ConnectorVersion::Sqlite => &SqliteConnectorTag, + ConnectorVersion::Sqlite(_) => &SqliteConnectorTag, ConnectorVersion::CockroachDb(_) => &CockroachDbConnectorTag, ConnectorVersion::Vitess(_) => &VitessConnectorTag, }; diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs index ecc055d5d8d2..6cc6120f71c8 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/mod.rs @@ -18,7 +18,7 @@ pub(crate) use sql_server::*; pub(crate) use sqlite::*; pub(crate) use vitess::*; -use crate::{datamodel_rendering::DatamodelRenderer, BoxFuture, TestError, CONFIG}; +use crate::{datamodel_rendering::DatamodelRenderer, BoxFuture, TestConfig, TestError, CONFIG}; use psl::datamodel_connector::ConnectorCapabilities; use std::{convert::TryFrom, fmt}; @@ -49,12 +49,13 @@ pub trait ConnectorTagInterface { /// - `is_ci` signals whether or not the test run is done on CI or not. May be important if local /// test run connection strings and CI connection strings differ because of networking. pub(crate) fn connection_string( + test_config: &TestConfig, version: &ConnectorVersion, database: &str, - is_ci: bool, is_multi_schema: bool, isolation_level: Option<&'static str>, ) -> String { + let is_ci = test_config.is_ci; match version { ConnectorVersion::SqlServer(v) => { let database = if is_multi_schema { @@ -98,7 +99,7 @@ pub(crate) fn connection_string( Some(PostgresVersion::V12) if is_ci => { format!("postgresql://postgres:prisma@test-db-postgres-12:5432/{database}") } - Some(PostgresVersion::V13) if is_ci => { + Some(PostgresVersion::V13) | Some(PostgresVersion::NeonJs) | Some(PostgresVersion::PgJs) if is_ci => { format!("postgresql://postgres:prisma@test-db-postgres-13:5432/{database}") } Some(PostgresVersion::V14) if is_ci => { @@ -115,7 +116,9 @@ pub(crate) fn connection_string( Some(PostgresVersion::V10) => format!("postgresql://postgres:prisma@127.0.0.1:5432/{database}"), Some(PostgresVersion::V11) => format!("postgresql://postgres:prisma@127.0.0.1:5433/{database}"), Some(PostgresVersion::V12) => format!("postgresql://postgres:prisma@127.0.0.1:5434/{database}"), - Some(PostgresVersion::V13) => format!("postgresql://postgres:prisma@127.0.0.1:5435/{database}"), + Some(PostgresVersion::V13) | Some(PostgresVersion::NeonJs) | Some(PostgresVersion::PgJs) => { + format!("postgresql://postgres:prisma@127.0.0.1:5435/{database}") + } Some(PostgresVersion::V14) => format!("postgresql://postgres:prisma@127.0.0.1:5437/{database}"), Some(PostgresVersion::V15) => format!("postgresql://postgres:prisma@127.0.0.1:5438/{database}"), Some(PostgresVersion::PgBouncer) => { @@ -162,7 +165,7 @@ pub(crate) fn connection_string( } None => unreachable!("A versioned connector must have a concrete version to run."), }, - ConnectorVersion::Sqlite => { + ConnectorVersion::Sqlite(_) => { let workspace_root = std::env::var("WORKSPACE_ROOT") .unwrap_or_else(|_| ".".to_owned()) .trim_end_matches('/') @@ -196,7 +199,12 @@ pub(crate) fn connection_string( None => unreachable!("A versioned connector must have a concrete version to run."), } } + ConnectorVersion::Vitess(Some(VitessVersion::V8_0)) => "mysql://root@localhost:33807/test".into(), + ConnectorVersion::Vitess(Some(VitessVersion::PlanetscaleJs)) => { + format!("mysql://root@127.0.0.1:3310/{database}") + } + ConnectorVersion::Vitess(None) => unreachable!("A versioned connector must have a concrete version to run."), } } @@ -209,12 +217,25 @@ pub enum ConnectorVersion { Postgres(Option), MySql(Option), MongoDb(Option), - Sqlite, + Sqlite(Option), CockroachDb(Option), Vitess(Option), } impl ConnectorVersion { + fn is_broader(&self, other: &ConnectorVersion) -> bool { + matches!( + (self, other), + (Self::SqlServer(None), Self::SqlServer(_)) + | (Self::Postgres(None), Self::Postgres(_)) + | (Self::MySql(None), Self::MySql(_)) + | (Self::MongoDb(None), Self::MongoDb(_)) + | (Self::Sqlite(None), Self::Sqlite(_)) + | (Self::CockroachDb(None), Self::CockroachDb(_)) + | (Self::Vitess(None), Self::Vitess(_)) + ) + } + fn matches_pattern(&self, pat: &ConnectorVersion) -> bool { use ConnectorVersion::*; @@ -232,14 +253,14 @@ impl ConnectorVersion { (MongoDb(a), MongoDb(b)) => versions_match(a, b), (CockroachDb(a), CockroachDb(b)) => versions_match(a, b), (Vitess(a), Vitess(b)) => versions_match(a, b), - (Sqlite, Sqlite) => true, + (Sqlite(a), Sqlite(b)) => versions_match(a, b), (MongoDb(..), _) | (_, MongoDb(..)) | (SqlServer(..), _) | (_, SqlServer(..)) - | (Sqlite, _) - | (_, Sqlite) + | (Sqlite(..), _) + | (_, Sqlite(..)) | (CockroachDb(..), _) | (_, CockroachDb(..)) | (Vitess(..), _) @@ -269,7 +290,10 @@ impl fmt::Display for ConnectorVersion { Some(v) => format!("MongoDB ({})", v.to_string()), None => "MongoDB (unknown)".to_string(), }, - Self::Sqlite => "SQLite".to_string(), + Self::Sqlite(v) => match v { + Some(v) => format!("SQLite ({})", v.to_string()), + None => "SQLite (unknown)".to_string(), + }, Self::Vitess(v) => match v { Some(v) => format!("Vitess ({v})"), None => "Vitess (unknown)".to_string(), @@ -284,52 +308,47 @@ impl fmt::Display for ConnectorVersion { /// Determines whether or not a test should run for the given enabled connectors and capabilities /// a connector is required to have. pub(crate) fn should_run( + connector: &ConnectorTag, + version: &ConnectorVersion, only: &[(&str, Option<&str>)], exclude: &[(&str, Option<&str>)], capabilities: ConnectorCapabilities, ) -> bool { - let (connector, version) = CONFIG.test_connector().unwrap(); - if !capabilities.is_empty() && !connector.capabilities().contains(capabilities) { println!("Connector excluded. Missing required capability."); return false; } - // We skip tests that exclude JS driver adapters when an external test executor is configured. - // A test that you only want to run with rust drivers can be annotated with exclude(JS) - if CONFIG.external_test_executor().is_some() && exclude.iter().any(|excl| excl.0.to_uppercase() == "JS") { - println!("Excluded test execution for JS driver adapters. Skipping test"); - return false; - }; - // we consume the JS token to prevent it from being used in the following checks - let exclude: Vec<_> = exclude.iter().filter(|excl| excl.0.to_uppercase() != "JS").collect(); - - // We only run tests that include JS driver adapters when an external test executor is configured. - // A test that you only want to run with js driver adapters can be annotated with only(JS) - if CONFIG.external_test_executor().is_none() && only.iter().any(|incl| incl.0.to_uppercase() == "JS") { - println!("Excluded test execution for rust driver adapters. Skipping test"); - return false; - } - // we consume the JS token to prevent it from being used in the following checks - let only: Vec<_> = only.iter().filter(|incl| incl.0.to_uppercase() != "JS").collect(); + let exclusions = exclude + .iter() + .filter_map(|c| ConnectorVersion::try_from(*c).ok()) + .collect::>(); + + let inclusions = only + .iter() + .filter_map(|c| ConnectorVersion::try_from(*c).ok()) + .collect::>(); - if !only.is_empty() { - return only - .iter() - .any(|incl| ConnectorVersion::try_from(**incl).unwrap().matches_pattern(&version)); + for exclusion in exclusions.iter() { + for inclusion in inclusions.iter() { + if exclusion.is_broader(inclusion) { + panic!("Error in connector test execution rules. Version `{exclusion}` in `excluded()` is broader than `{inclusion}` in `only()`"); + } + } } - if exclude.iter().any(|excl| { - ConnectorVersion::try_from(**excl) - .map_or(false, |connector_version| connector_version.matches_pattern(&version)) - }) { + if exclusions.iter().any(|excl| excl.matches_pattern(version)) { println!("Connector excluded. Skipping test."); return false; } + if !inclusions.is_empty() { + return inclusions.iter().any(|incl| incl.matches_pattern(version)); + } + // FIXME: This skips vitess unless explicitly opted in. Replace with `true` when fixing // https://github.com/prisma/client-planning/issues/332 - !matches!(version, ConnectorVersion::Vitess(_)) + CONFIG.external_test_executor().is_some() || !matches!(version, ConnectorVersion::Vitess(_)) } impl TryFrom<(&str, Option<&str>)> for ConnectorVersion { @@ -338,7 +357,7 @@ impl TryFrom<(&str, Option<&str>)> for ConnectorVersion { #[track_caller] fn try_from((connector, version): (&str, Option<&str>)) -> Result { Ok(match connector.to_lowercase().as_str() { - "sqlite" => ConnectorVersion::Sqlite, + "sqlite" => ConnectorVersion::Sqlite(version.map(SqliteVersion::try_from).transpose()?), "sqlserver" => ConnectorVersion::SqlServer(version.map(SqlServerVersion::try_from).transpose()?), "cockroachdb" => ConnectorVersion::CockroachDb(version.map(CockroachDbVersion::try_from).transpose()?), "postgres" => ConnectorVersion::Postgres(version.map(PostgresVersion::try_from).transpose()?), @@ -349,3 +368,44 @@ impl TryFrom<(&str, Option<&str>)> for ConnectorVersion { }) } } + +#[cfg(test)] +mod tests { + use crate::connector_tag::{PostgresConnectorTag, PostgresVersion}; + use crate::{ConnectorTag, ConnectorVersion}; + + #[test] + #[rustfmt::skip] + fn test_should_run() { + let only = vec![("postgres", None)]; + let exclude = vec![("postgres", Some("neon.js"))]; + let postgres = &PostgresConnectorTag as ConnectorTag; + let neon = ConnectorVersion::Postgres(Some(PostgresVersion::NeonJs)); + let pg = ConnectorVersion::Postgres(Some(PostgresVersion::PgJs)); + + assert!(!super::should_run(&postgres, &neon, &only, &exclude, Default::default())); + assert!(super::should_run(&postgres, &pg, &only, &exclude, Default::default())); + } + + #[test] + #[should_panic] + fn test_should_run_wrong_definition_versionless() { + let only = vec![("postgres", None)]; + let exclude = vec![("postgres", None)]; + let postgres = &PostgresConnectorTag as ConnectorTag; + let neon = ConnectorVersion::Postgres(Some(PostgresVersion::NeonJs)); + + super::should_run(&postgres, &neon, &only, &exclude, Default::default()); + } + + #[test] + #[should_panic] + fn test_should_run_wrong_definition_wider_exclusion() { + let only = vec![("postgres", Some("neon.js"))]; + let exclude = vec![("postgres", None)]; + let postgres = &PostgresConnectorTag as ConnectorTag; + let neon = ConnectorVersion::Postgres(Some(PostgresVersion::NeonJs)); + + super::should_run(&postgres, &neon, &only, &exclude, Default::default()); + } +} diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/postgres.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/postgres.rs index 039231a3f74e..42d0a8c7afdc 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/postgres.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/postgres.rs @@ -36,6 +36,8 @@ pub enum PostgresVersion { V14, V15, PgBouncer, + NeonJs, + PgJs, } impl TryFrom<&str> for PostgresVersion { @@ -51,6 +53,8 @@ impl TryFrom<&str> for PostgresVersion { "14" => Self::V14, "15" => Self::V15, "pgbouncer" => Self::PgBouncer, + "neon.js" => Self::NeonJs, + "pg.js" => Self::PgJs, _ => return Err(TestError::parse_error(format!("Unknown Postgres version `{s}`"))), }; @@ -69,6 +73,8 @@ impl ToString for PostgresVersion { PostgresVersion::V14 => "14", PostgresVersion::V15 => "15", PostgresVersion::PgBouncer => "pgbouncer", + PostgresVersion::NeonJs => "neon.js", + PostgresVersion::PgJs => "pg.js", } .to_owned() } diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/sqlite.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/sqlite.rs index 16b16cf5ba22..5f4dab56784a 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/sqlite.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/sqlite.rs @@ -25,3 +25,31 @@ impl ConnectorTagInterface for SqliteConnectorTag { psl::builtin_connectors::SQLITE.capabilities() } } + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum SqliteVersion { + V3, + LibsqlJS, +} + +impl ToString for SqliteVersion { + fn to_string(&self) -> String { + match self { + SqliteVersion::V3 => "3".to_string(), + SqliteVersion::LibsqlJS => "libsql.js".to_string(), + } + } +} + +impl TryFrom<&str> for SqliteVersion { + type Error = TestError; + + fn try_from(s: &str) -> Result { + let version = match s { + "3" => Self::V3, + "libsql.js" => Self::LibsqlJS, + _ => return Err(TestError::parse_error(format!("Unknown SQLite version `{s}`"))), + }; + Ok(version) + } +} diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/vitess.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/vitess.rs index 0376f45abbcf..ce827927b403 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/vitess.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/connector_tag/vitess.rs @@ -34,6 +34,7 @@ impl ConnectorTagInterface for VitessConnectorTag { #[derive(Debug, Clone, Copy, PartialEq)] pub enum VitessVersion { V8_0, + PlanetscaleJs, } impl FromStr for VitessVersion { @@ -42,6 +43,7 @@ impl FromStr for VitessVersion { fn from_str(s: &str) -> Result { let version = match s { "8.0" => Self::V8_0, + "planetscale.js" => Self::PlanetscaleJs, _ => return Err(TestError::parse_error(format!("Unknown Vitess version `{s}`"))), }; @@ -53,6 +55,7 @@ impl Display for VitessVersion { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::V8_0 => write!(f, "8.0"), + Self::PlanetscaleJs => write!(f, "planetscale.js"), } } } diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs index ea7360c56fa6..7295972f9812 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/datamodel_rendering/mod.rs @@ -62,13 +62,7 @@ pub fn render_test_datamodel( }} "#}, tag.datamodel_provider(), - connection_string( - &version, - test_database, - CONFIG.is_ci(), - is_multi_schema, - isolation_level - ), + connection_string(&CONFIG, &version, test_database, is_multi_schema, isolation_level), relation_mode_override.unwrap_or_else(|| tag.relation_mode().to_string()), schema_def, preview_features diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/lib.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/lib.rs index 2e79581a0c78..af99d9a7a7d3 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/lib.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/lib.rs @@ -152,8 +152,9 @@ fn run_relation_link_test_impl( let required_capabilities_for_test = required_capabilities | caps; let test_db_name = format!("{suite_name}_{test_name}_{i}"); let template = dm.datamodel().to_owned(); + let (connector, version) = CONFIG.test_connector().unwrap(); - if !should_run(only, exclude, required_capabilities_for_test) { + if !should_run(&connector, &version, only, exclude, required_capabilities_for_test) { continue; } @@ -250,7 +251,9 @@ fn run_connector_test_impl( referential_override: Option, test_fn: &dyn Fn(Runner) -> BoxFuture<'static, TestResult<()>>, ) { - if !should_run(only, exclude, capabilities) { + let (connector, version) = CONFIG.test_connector().unwrap(); + + if !should_run(&connector, &version, only, exclude, capabilities) { return; } diff --git a/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite b/query-engine/connector-test-kit-rs/test-configs/libsql-js similarity index 77% rename from query-engine/connector-test-kit-rs/test-configs/libsql-sqlite rename to query-engine/connector-test-kit-rs/test-configs/libsql-js index d1532fc12584..9c7ffe8f8473 100644 --- a/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite +++ b/query-engine/connector-test-kit-rs/test-configs/libsql-js @@ -1,5 +1,6 @@ { "connector": "sqlite", + "version": "libsql.js", "driver_adapter": "libsql", "external_test_executor": "Napi" } \ No newline at end of file diff --git a/query-engine/connector-test-kit-rs/test-configs/libsql-sqlite-wasm b/query-engine/connector-test-kit-rs/test-configs/libsql-wasm similarity index 100% rename from query-engine/connector-test-kit-rs/test-configs/libsql-sqlite-wasm rename to query-engine/connector-test-kit-rs/test-configs/libsql-wasm diff --git a/query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13 b/query-engine/connector-test-kit-rs/test-configs/neon-js similarity index 51% rename from query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13 rename to query-engine/connector-test-kit-rs/test-configs/neon-js index bb2034d0e460..ac76377ac66d 100644 --- a/query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13 +++ b/query-engine/connector-test-kit-rs/test-configs/neon-js @@ -1,7 +1,7 @@ { "connector": "postgres", - "version": "13", + "version": "neon.js", "driver_adapter": "neon:ws", - "driver_adapter_config": { "proxyUrl": "127.0.0.1:5488/v1" }, + "driver_adapter_config": { "proxy_url": "127.0.0.1:5488/v1" }, "external_test_executor": "Napi" } \ No newline at end of file diff --git a/query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13-wasm b/query-engine/connector-test-kit-rs/test-configs/neon-wasm similarity index 64% rename from query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13-wasm rename to query-engine/connector-test-kit-rs/test-configs/neon-wasm index 6b1e9c0d1286..2697c5227399 100644 --- a/query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13-wasm +++ b/query-engine/connector-test-kit-rs/test-configs/neon-wasm @@ -2,6 +2,6 @@ "connector": "postgres", "version": "13", "driver_adapter": "neon:ws", - "driver_adapter_config": { "proxyUrl": "127.0.0.1:5488/v1" }, + "driver_adapter_config": { "proxy_url": "127.0.0.1:5488/v1" }, "external_test_executor": "Wasm" } \ No newline at end of file diff --git a/query-engine/connector-test-kit-rs/test-configs/pg-postgres13 b/query-engine/connector-test-kit-rs/test-configs/pg-js similarity index 79% rename from query-engine/connector-test-kit-rs/test-configs/pg-postgres13 rename to query-engine/connector-test-kit-rs/test-configs/pg-js index 4a2653dd3d2e..23fddfd72a06 100644 --- a/query-engine/connector-test-kit-rs/test-configs/pg-postgres13 +++ b/query-engine/connector-test-kit-rs/test-configs/pg-js @@ -1,6 +1,6 @@ { "connector": "postgres", - "version": "13", + "version": "pg.js", "driver_adapter": "pg", "external_test_executor": "Napi" } \ No newline at end of file diff --git a/query-engine/connector-test-kit-rs/test-configs/pg-postgres13-wasm b/query-engine/connector-test-kit-rs/test-configs/pg-wasm similarity index 100% rename from query-engine/connector-test-kit-rs/test-configs/pg-postgres13-wasm rename to query-engine/connector-test-kit-rs/test-configs/pg-wasm diff --git a/query-engine/connector-test-kit-rs/test-configs/planetscale-js b/query-engine/connector-test-kit-rs/test-configs/planetscale-js new file mode 100644 index 000000000000..327ad94ba661 --- /dev/null +++ b/query-engine/connector-test-kit-rs/test-configs/planetscale-js @@ -0,0 +1,9 @@ +{ + "connector": "vitess", + "version": "planetscale.js", + "driver_adapter": "planetscale", + "driver_adapter_config": { + "proxy_url": "http://root:root@127.0.0.1:8085" + }, + "external_test_executor": "Napi" +} diff --git a/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8 b/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8 deleted file mode 100644 index b823cc106997..000000000000 --- a/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "connector": "vitess", - "version": "8.0", - "driver_adapter": "planetscale", - "driver_adapter_config": { "proxyUrl": "http://root:root@127.0.0.1:8085" }, - "external_test_executor": "Napi" -} diff --git a/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8-wasm b/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8-wasm deleted file mode 100644 index d4ee0627759a..000000000000 --- a/query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8-wasm +++ /dev/null @@ -1,7 +0,0 @@ -{ - "connector": "vitess", - "version": "8.0", - "driver_adapter": "planetscale", - "driver_adapter_config": { "proxyUrl": "http://root:root@127.0.0.1:8085" }, - "external_test_executor": "Wasm" -} diff --git a/query-engine/connector-test-kit-rs/test-configs/planetscale-wasm b/query-engine/connector-test-kit-rs/test-configs/planetscale-wasm new file mode 100644 index 000000000000..62dd895e970c --- /dev/null +++ b/query-engine/connector-test-kit-rs/test-configs/planetscale-wasm @@ -0,0 +1,9 @@ +{ + "connector": "vitess", + "version": "planetscale.js", + "driver_adapter": "planetscale", + "driver_adapter_config": { + "proxy_url": "http://root:root@127.0.0.1:8085" + }, + "external_test_executor": "Wasm" +} diff --git a/query-engine/connector-test-kit-rs/test-configs/sqlite b/query-engine/connector-test-kit-rs/test-configs/sqlite index cfbcc7e8829b..092f9182ec91 100644 --- a/query-engine/connector-test-kit-rs/test-configs/sqlite +++ b/query-engine/connector-test-kit-rs/test-configs/sqlite @@ -1,2 +1,4 @@ { - "connector": "sqlite"} \ No newline at end of file + "connector": "sqlite", + "version": "3" +} \ No newline at end of file diff --git a/query-engine/driver-adapters/connector-test-kit-executor/src/index.ts b/query-engine/driver-adapters/connector-test-kit-executor/src/index.ts index 3ea8aaf147b9..4e847742e51b 100644 --- a/query-engine/driver-adapters/connector-test-kit-executor/src/index.ts +++ b/query-engine/driver-adapters/connector-test-kit-executor/src/index.ts @@ -250,7 +250,7 @@ async function pgAdapter(url: string): Promise { } async function neonWsAdapter(url: string): Promise { - const proxyURL = JSON.parse(process.env.DRIVER_ADAPTER_CONFIG || '{}').proxyUrl ?? '' + const proxyURL = JSON.parse(process.env.DRIVER_ADAPTER_CONFIG || '{}').proxy_url ?? '' if (proxyURL == '') { throw new Error("DRIVER_ADAPTER_CONFIG is not defined or empty, but its required for neon adapter."); } @@ -270,7 +270,7 @@ async function libsqlAdapter(url: string): Promise { } async function planetscaleAdapter(url: string): Promise { - const proxyURL = JSON.parse(process.env.DRIVER_ADAPTER_CONFIG || '{}').proxyUrl ?? '' + const proxyURL = JSON.parse(process.env.DRIVER_ADAPTER_CONFIG || '{}').proxy_url ?? '' if (proxyURL == '') { throw new Error("DRIVER_ADAPTER_CONFIG is not defined or empty, but its required for planetscale adapter."); } diff --git a/query-engine/driver-adapters/package.json b/query-engine/driver-adapters/package.json index e137d6a524b2..869da0a98173 100644 --- a/query-engine/driver-adapters/package.json +++ b/query-engine/driver-adapters/package.json @@ -11,7 +11,7 @@ "scripts": { "build": "pnpm -r run build", "lint": "pnpm -r run lint", - "clean": "git clean -nXd -e !query-engine/driver-adapters" + "clean": "git clean -dXf -e !query-engine/driver-adapters" }, "keywords": [], "author": "",