-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qe: Allow to run query engine test suite against wasm engines
Intoroduces new environment variable/test config option,
`EXTERNAL_TEST_EXECUTOR_ENGINE` that can be either `NAPI` (default) or
`WASM` that affects which engine external test executor will start with.
Adds a bunch of additional test configs for driver adapters that
duplicate existing ones, but run against WASM engine.
Close prisma/team-orm#551
- Loading branch information
Sergey Tatarintsev
committed
Nov 20, 2023
1 parent
ebb702b
commit 4b91480
Showing
15 changed files
with
162 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"connector": "sqlite", | ||
"driver_adapter": "libsql", | ||
"external_test_executor": "default" | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "NAPI" | ||
} |
6 changes: 6 additions & 0 deletions
6
query-engine/connector-test-kit-rs/test-configs/libsql-sqlite-wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"connector": "sqlite", | ||
"driver_adapter": "libsql", | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "WASM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
query-engine/connector-test-kit-rs/test-configs/neon-ws-postgres13-wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"connector": "postgres", | ||
"version": "13", | ||
"driver_adapter": "neon:ws", | ||
"driver_adapter_config": { "proxyUrl": "127.0.0.1:5488/v1" }, | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "WASM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
query-engine/connector-test-kit-rs/test-configs/pg-postgres13-wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"connector": "postgres", | ||
"version": "13", | ||
"driver_adapter": "pg", | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "WASM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,6 @@ | |
"version": "8.0", | ||
"driver_adapter": "planetscale", | ||
"driver_adapter_config": { "proxyUrl": "http://root:[email protected]:8085" }, | ||
"external_test_executor": "default" | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "NAPI" | ||
} |
8 changes: 8 additions & 0 deletions
8
query-engine/connector-test-kit-rs/test-configs/planetscale-vitess8-wasm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"connector": "vitess", | ||
"version": "8.0", | ||
"driver_adapter": "planetscale", | ||
"driver_adapter_config": { "proxyUrl": "http://root:[email protected]:8085" }, | ||
"external_test_executor": "default", | ||
"external_test_executor_engine": "WASM" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
query-engine/driver-adapters/connector-test-kit-executor/src/wasm.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as wasm from '../../../query-engine-wasm/pkg/query_engine_bg.js' | ||
import fs from 'node:fs/promises' | ||
import path from 'node:path' | ||
import { fileURLToPath } from 'node:url' | ||
|
||
const dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
|
||
const bytes = await fs.readFile(path.resolve(dirname, '..', '..', '..', 'query-engine-wasm', 'pkg', 'query_engine_bg.wasm')) | ||
const module = new WebAssembly.Module(bytes) | ||
const instance = new WebAssembly.Instance(module, { './query_engine_bg.js': wasm }) | ||
wasm.__wbg_set_wasm(instance.exports); | ||
wasm.init() | ||
|
||
export const WasmQueryEngine = wasm.QueryEngine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters