From 3df5653ab62bba28614d8613aaf8fada987ee571 Mon Sep 17 00:00:00 2001 From: Luiz Carvalho Date: Thu, 2 Feb 2023 01:17:09 -0300 Subject: [PATCH] fix(tests): fix tests rebasing --- Cargo.toml | 1 + tests/docker-compose.yml | 28 ---------------------------- tests/sqlite/error.rs | 8 ++++---- tests/sqlite/sqlite.db | Bin 36864 -> 36864 bytes tests/x.py | 38 +++++++++++++------------------------- 5 files changed, 18 insertions(+), 57 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e92c64fc93..da437616d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -223,6 +223,7 @@ name = "sqlite-derives" path = "tests/sqlite/derives.rs" required-features = ["sqlite", "macros"] +[[test]] name = "sqlite-error" path = "tests/sqlite/error.rs" required-features = ["sqlite"] diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index bd8ce46297..8651ff5a43 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -173,34 +173,6 @@ services: - "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql" command: > -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key - # - # Microsoft SQL Server (MSSQL) - # https://hub.docker.com/_/microsoft-mssql-server - # - - mssql_2019: - build: - context: . - dockerfile: mssql/Dockerfile - args: - VERSION: 2019-latest - ports: - - 1433 - environment: - ACCEPT_EULA: "Y" - SA_PASSWORD: Password123! - - mssql_2017: - build: - context: . - dockerfile: mssql/mssql-2017.dockerfile - args: - VERSION: 2017-latest - ports: - - 1433 - environment: - ACCEPT_EULA: "Y" - SA_PASSWORD: Password123! # # IBM Db2 diff --git a/tests/sqlite/error.rs b/tests/sqlite/error.rs index efbdcc6837..21a075c417 100644 --- a/tests/sqlite/error.rs +++ b/tests/sqlite/error.rs @@ -7,7 +7,7 @@ async fn it_fails_with_unique_violation() -> anyhow::Result<()> { let mut tx = conn.begin().await?; let res: Result<_, sqlx::Error> = sqlx::query("INSERT INTO tweet VALUES (1, 'Foo', true, 1);") - .execute(&mut tx) + .execute(&mut *tx) .await; let err = res.unwrap_err(); @@ -25,7 +25,7 @@ async fn it_fails_with_foreign_key_violation() -> anyhow::Result<()> { let res: Result<_, sqlx::Error> = sqlx::query("INSERT INTO tweet_reply (id, tweet_id, text) VALUES (2, 2, 'Reply!');") - .execute(&mut tx) + .execute(&mut *tx) .await; let err = res.unwrap_err(); @@ -42,7 +42,7 @@ async fn it_fails_with_not_null_violation() -> anyhow::Result<()> { let mut tx = conn.begin().await?; let res: Result<_, sqlx::Error> = sqlx::query("INSERT INTO tweet (text) VALUES (null);") - .execute(&mut tx) + .execute(&mut *tx) .await; let err = res.unwrap_err(); @@ -60,7 +60,7 @@ async fn it_fails_with_check_violation() -> anyhow::Result<()> { let res: Result<_, sqlx::Error> = sqlx::query("INSERT INTO products VALUES (1, 'Product 1', 0);") - .execute(&mut tx) + .execute(&mut *tx) .await; let err = res.unwrap_err(); diff --git a/tests/sqlite/sqlite.db b/tests/sqlite/sqlite.db index da8aac9fe31ab1e9f6464307caa72d3f6afcb73c..905fbbe8ef539636a36a715baa5a7e53f527856a 100644 GIT binary patch delta 104 zcmZozz|^pSX#