Skip to content

Commit

Permalink
test(d1): un-exclude tests related to incorrect count of changed rows (
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed May 7, 2024
1 parent b34f35d commit f77c9dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export FMT_SQL=1 # Uncomment it to enable logging formatted SQL queries

### Uncomment to run driver adapters tests. See query-engine-driver-adapters.yml workflow for how tests run in CI.
# export EXTERNAL_TEST_EXECUTOR="napi"
# export DRIVER_ADAPTER=pg # Set to pg, neon or planetscale
# export DRIVER_ADAPTER=pg # Set to pg, neon, planetscale, libsql or cfd1
# export PRISMA_DISABLE_QUAINT_EXECUTORS=1 # Disable quaint executors for driver adapters
# export DRIVER_ADAPTER_URL_OVERRIDE ="postgres://USER:PASSWORD@DATABASExxxx" # Override the database url for the driver adapter tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ As explained in [Testing driver adapters](./query-engine/connector-test-kit-rs/R
will ensure you have prisma checked out in your filesystem in the same directory as prisma-engines. This is needed because the driver adapters code is symlinked in prisma-engines.

When working on a feature or bugfix spanning adapters code and query-engine code, you will need to open sibling PRs in `prisma/prisma` and `prisma/prisma-engines` respectively.
Locally, each time you run `DRIVER_ADAPTER=$adapter make qe-test` tests will run using the driver adapters built from the source code in the working copy of prisma/prisma. All good.
Locally, each time you run `DRIVER_ADAPTER=$adapter make test-qe` tests will run using the driver adapters built from the source code in the working copy of prisma/prisma. All good.

In CI, tho', we need to denote which branch of prisma/prisma we want to use for tests. In CI, there's no working copy of prisma/prisma before tests run.
The CI jobs clones prisma/prisma `main` branch by default, which doesn't include your local changes. To test in integration, we can tell CI to use the branch of prisma/prisma containing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mod cockroachdb {
mod single_col {
use query_engine_tests::run_query;

#[connector_test(exclude(CockroachDb, Sqlite("cfd1")))]
#[connector_test(exclude(CockroachDb))]
async fn foo(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, "mutation { createManyTestModel(data: [{},{}]) { count }}"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use query_engine_tests::*;

// TODO: create many returns the wrong count for CFD1
#[test_suite(capabilities(CreateMany), exclude(Sqlite("cfd1")))]
#[test_suite(capabilities(CreateMany))]
mod create_many {
use indoc::indoc;
use query_engine_tests::{assert_error, run_query};
Expand Down Expand Up @@ -212,7 +211,8 @@ mod create_many {
// Covers: Batching by row number.
// Each DB allows a certain amount of params per single query, and a certain number of rows.
// Each created row has 1 param and we create 1000 records.
#[connector_test(schema(schema_4))]
// TODO: unexclude d1 once https://github.com/prisma/team-orm/issues/1070 is fixed
#[connector_test(schema(schema_4), exclude(Sqlite("cfd1")))]
async fn large_num_records_horizontal(runner: Runner) -> TestResult<()> {
let mut records: Vec<String> = vec![];

Expand Down Expand Up @@ -250,7 +250,8 @@ mod create_many {
// Covers: Batching by row number.
// Each DB allows a certain amount of params per single query, and a certain number of rows.
// Each created row has 4 params and we create 1000 rows.
#[connector_test(schema(schema_5))]
// TODO: unexclude d1 once https://github.com/prisma/team-orm/issues/1070 is fixed
#[connector_test(schema(schema_5), exclude(Sqlite("cfd1")))]
async fn large_num_records_vertical(runner: Runner) -> TestResult<()> {
let mut records: Vec<String> = vec![];

Expand Down

0 comments on commit f77c9dd

Please sign in to comment.