Skip to content

Commit

Permalink
Merge branch 'main' into fix/enum-min-max-casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Fernández authored Nov 22, 2023
2 parents 303e84f + 747c5fa commit 3e2a2ce
Show file tree
Hide file tree
Showing 101 changed files with 4,462 additions and 3,823 deletions.
2 changes: 1 addition & 1 deletion .buildkite/engineer
Original file line number Diff line number Diff line change
Expand Up @@ -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.62/latest/$OS/engineer.gz" --output engineer.gz
curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.63/latest/$OS/engineer.gz" --output engineer.gz
gzip -d engineer.gz
chmod +x engineer

Expand Down
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export QE_LOG_LEVEL=debug # Set it to "trace" to enable query-graph debugging lo
# 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="$(pwd)/query-engine/driver-adapters/js/connector-test-kit-executor/script/start_node.sh"
# export EXTERNAL_TEST_EXECUTOR="napi"
# export DRIVER_ADAPTER=pg # Set to pg, neon or planetscale
# 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
27 changes: 27 additions & 0 deletions .github/workflows/qe-wasm-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: WASM engine compile check
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/qe-wasm-check.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
- 'CODEOWNERS'
- 'renovate.json'

jobs:
build:
name: 'Compilation check for query-engine-wasm'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Build wasm query engine
run: ./build.sh
working-directory: ./query-engine/query-engine-wasm
24 changes: 19 additions & 5 deletions .github/workflows/query-engine-driver-adapters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,22 @@ jobs:
fail-fast: false
matrix:
adapter:
- name: 'pg'
- name: 'pg (napi)'
setup_task: 'dev-pg-postgres13'
- name: 'neon:ws'
- name: 'neon:ws (napi)'
setup_task: 'dev-neon-ws-postgres13'
- name: 'libsql'
- name: 'libsql (napi)'
setup_task: 'dev-libsql-sqlite'
# TODO: uncomment when WASM engine is functional
# - name: 'pg (wasm)'
# setup_task: 'dev-pg-postgres13-wasm'
# needs_wasm_pack: true
# - name: 'neon:ws (wasm)'
# setup_task: 'dev-neon-ws-postgres13-wasm'
# needs_wasm_pack: true
# - name: 'libsql (wasm)'
# setup_task: 'dev-libsql-sqlite-wasm'
# needs_wasm_pack: true
node_version: ['18']
env:
LOG_LEVEL: 'info' # Set to "debug" to trace the query engine and node process running the driver adapter
Expand Down Expand Up @@ -85,9 +95,13 @@ jobs:
echo "DRIVER_ADAPTERS_BRANCH=$branch" >> "$GITHUB_ENV"
fi
- run: make ${{ matrix.adapter.setup_task }}

- uses: dtolnay/rust-toolchain@stable

- name: 'Install wasm-pack'
if: ${{ matrix.adapter.needs_wasm_pack }}
run: cargo install wasm-pack

- run: make ${{ matrix.adapter.setup_task }}

- name: 'Run tests'
run: cargo test --package query-engine-tests -- --test-threads=1
8 changes: 4 additions & 4 deletions .github/workflows/query-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
fail-fast: false
matrix:
database:
- name: 'vitess_5_7'
single_threaded: true
connector: 'vitess'
version: '5.7'
- name: 'vitess_8_0'
single_threaded: true
connector: 'vitess'
Expand All @@ -41,6 +37,10 @@ jobs:
single_threaded: false
connector: 'sqlserver'
version: '2022'
- name: 'sqlite'
single_threaded: false
connector: 'sqlite'
version: '3'
- name: 'mongodb_4_2'
single_threaded: true
connector: 'mongodb'
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/schema-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ jobs:
url: 'postgresql://prisma@localhost:26257'
- name: sqlite
url: sqlite
- name: vitess_5_7
url: 'mysql://root:prisma@localhost:33577/test'
shadow_database_url: 'mysql://root:prisma@localhost:33578/shadow'
is_vitess: true
single_threaded: true
- name: vitess_8_0
url: 'mysql://root:prisma@localhost:33807/test'
shadow_database_url: 'mysql://root:prisma@localhost:33808/shadow'
Expand Down
2 changes: 0 additions & 2 deletions .test_database_urls/vitess_5_7

This file was deleted.

28 changes: 18 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ features = [
"pooled",
"postgresql",
"sqlite",
"native",
]

[profile.dev.package.backtrace]
Expand Down
44 changes: 34 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ ifndef DRIVER_ADAPTER
cargo test --package query-engine-tests
else
@echo "Executing query engine tests with $(DRIVER_ADAPTER) driver adapter"; \
# Add your actual command for the "test-driver-adapter" task here
$(MAKE) test-driver-adapter-$(DRIVER_ADAPTER);
if [ "$(ENGINE)" = "wasm" ]; then \
$(MAKE) test-driver-adapter-$(DRIVER_ADAPTER)-wasm; \
else \
$(MAKE) test-driver-adapter-$(DRIVER_ADAPTER); \
fi
endif

test-qe-verbose:
Expand Down Expand Up @@ -91,6 +94,12 @@ test-libsql-sqlite: dev-libsql-sqlite test-qe-st

test-driver-adapter-libsql: test-libsql-sqlite

dev-libsql-sqlite-wasm: build-qe-wasm build-connector-kit-js
cp $(CONFIG_PATH)/libsql-sqlite-wasm $(CONFIG_FILE)

test-libsql-sqlite-wasm: dev-libsql-sqlite-wasm test-qe-st
test-driver-adapter-libsql-sqlite-wasm: test-libsql-sqlite-wasm

start-postgres9:
docker compose -f docker-compose.yml up --wait -d --remove-orphans postgres9

Expand Down Expand Up @@ -121,14 +130,20 @@ start-postgres13:
dev-postgres13: start-postgres13
cp $(CONFIG_PATH)/postgres13 $(CONFIG_FILE)

start-pg-postgres13: build-qe-napi build-connector-kit-js start-postgres13
start-pg-postgres13: start-postgres13

dev-pg-postgres13: start-pg-postgres13
dev-pg-postgres13: start-pg-postgres13 build-qe-napi build-connector-kit-js
cp $(CONFIG_PATH)/pg-postgres13 $(CONFIG_FILE)

test-pg-postgres13: dev-pg-postgres13 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)

test-pg-postgres13-wasm: dev-pg-postgres13-wasm test-qe-st

test-driver-adapter-pg: test-pg-postgres13
test-driver-adapter-pg-wasm: test-pg-postgres13-wasm

start-neon-postgres13:
docker compose -f docker-compose.yml up --wait -d --remove-orphans neon-postgres13
Expand All @@ -138,7 +153,13 @@ dev-neon-ws-postgres13: start-neon-postgres13 build-qe-napi build-connector-kit-

test-neon-ws-postgres13: dev-neon-ws-postgres13 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)

test-neon-ws-postgres13-wasm: dev-neon-ws-postgres13-wasm test-qe-st

test-driver-adapter-neon: test-neon-ws-postgres13
test-driver-adapter-neon-wasm: test-neon-ws-postgres13-wasm

start-postgres14:
docker compose -f docker-compose.yml up --wait -d --remove-orphans postgres14
Expand Down Expand Up @@ -256,12 +277,6 @@ dev-mongodb_5: start-mongodb_5
dev-mongodb_4_2: start-mongodb_4_2
cp $(CONFIG_PATH)/mongodb42 $(CONFIG_FILE)

start-vitess_5_7:
docker compose -f docker-compose.yml up --wait -d --remove-orphans vitess-test-5_7 vitess-shadow-5_7

dev-vitess_5_7: start-vitess_5_7
cp $(CONFIG_PATH)/vitess_5_7 $(CONFIG_FILE)

start-vitess_8_0:
docker compose -f docker-compose.yml up --wait -d --remove-orphans vitess-test-8_0 vitess-shadow-8_0

Expand All @@ -276,7 +291,13 @@ dev-planetscale-vitess8: start-planetscale-vitess8 build-qe-napi build-connector

test-planetscale-vitess8: dev-planetscale-vitess8 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)

test-planetscale-vitess8-wasm: dev-planetscale-vitess8-wasm test-qe-st

test-driver-adapter-planetscale: test-planetscale-vitess8
test-driver-adapter-planetscale-wasm: test-planetscale-vitess8-wasm

######################
# Local dev commands #
Expand All @@ -285,6 +306,9 @@ test-driver-adapter-planetscale: test-planetscale-vitess8
build-qe-napi:
cargo build --package query-engine-node-api

build-qe-wasm:
cd query-engine/query-engine-wasm && ./build.sh

build-connector-kit-js: build-driver-adapters
cd query-engine/driver-adapters && pnpm i && pnpm build

Expand Down
40 changes: 0 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,26 +222,6 @@ services:
- databases
tmpfs: /var/lib/mariadb

vitess-test-5_7:
image: vitess/vttestserver:mysql57@sha256:23863a518b34330109c502ac61a396008f5f023e96263bcb2bb1b0f7f7d5dc7f
restart: unless-stopped
ports:
- 33577:33577
environment:
PORT: 33574
KEYSPACES: 'test'
NUM_SHARDS: '1'
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
ENABLE_ONLINE_DDL: false
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '500ms'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33577']
interval: 5s
timeout: 2s
retries: 20

vitess-test-8_0:
image: vitess/vttestserver:mysql80@sha256:8bec2644d83cb322eb2cdd596d33c0f858243ba6ade9164c95dfcc519643094e
restart: unless-stopped
Expand All @@ -262,26 +242,6 @@ services:
timeout: 2s
retries: 20

vitess-shadow-5_7:
image: vitess/vttestserver:mysql57@sha256:23863a518b34330109c502ac61a396008f5f023e96263bcb2bb1b0f7f7d5dc7f
restart: unless-stopped
ports:
- 33578:33577
environment:
PORT: 33574
KEYSPACES: 'shadow'
NUM_SHARDS: '1'
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
ENABLE_ONLINE_DDL: false
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '500ms'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33577']
interval: 5s
timeout: 2s
retries: 20

vitess-shadow-8_0:
image: vitess/vttestserver:mysql80@sha256:8bec2644d83cb322eb2cdd596d33c0f858243ba6ade9164c95dfcc519643094e
restart: unless-stopped
Expand Down
Loading

0 comments on commit 3e2a2ce

Please sign in to comment.