Skip to content

Commit

Permalink
Revert "chore(driver-adapters): remove references to query-engine-dri…
Browse files Browse the repository at this point in the history
…ver-adapters.yml"

This reverts commit eeaaa8f.
  • Loading branch information
miguelff committed Oct 26, 2023
1 parent 0c2ab39 commit 2ef6ee3
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export QE_LOG_LEVEL=debug # Set it to "trace" to enable query-graph debugging lo
# export PRISMA_RENDER_DOT_FILE=1 # Uncomment to enable rendering a dot file of the Query Graph from an executed query.
# export FMT_SQL=1 # Uncomment it to enable logging formatted SQL queries

### Uncomment to run driver adapters tests.
### 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 DRIVER_ADAPTER=pg # Set to pg, neon or planetscale
# export PRISMA_DISABLE_QUAINT_EXECUTORS=1 # Disable quaint executors for driver adapters
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/query-engine-driver-adapters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Driver Adapters
on:
push:
branches:
- main
pull_request:
paths-ignore:
- '.github/**'
- '!.github/workflows/query-engine-driver-adapters.yml'
- '.buildkite/**'
- '*.md'
- 'LICENSE'
- 'CODEOWNERS'
- 'renovate.json'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
rust-query-engine-tests:
name: 'Test `${{ matrix.adapter.name }}` on node v${{ matrix.node_version }}'

strategy:
fail-fast: false
matrix:
adapter:
- name: 'pg'
setup_task: 'dev-pg-postgres13'
- name: 'neon:ws'
setup_task: 'dev-neon-ws-postgres13'
- name: 'libsql'
setup_task: 'dev-libsql-sqlite'
- name: 'planetscale'
setup_task: 'dev-planetscale-vitess8'
node_version: ['18']
env:
LOG_LEVEL: 'info' # Set to "debug" to trace the query engine and node process running the driver adapter
LOG_QUERIES: 'y'
RUST_LOG: 'info'
RUST_LOG_FORMAT: 'devel'
RUST_BACKTRACE: '1'
CLICOLOR_FORCE: '1'
CLOSED_TX_CLEANUP: '2'
SIMPLE_TEST_MODE: '1'
QUERY_BATCH_SIZE: '10'
WORKSPACE_ROOT: ${{ github.workspace }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 'Setup Node.js'
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}

- name: 'Setup pnpm'
uses: pnpm/action-setup@v2
with:
version: 8

- name: 'Get pnpm store directory'
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 'Login to Docker Hub'
uses: docker/login-action@v3
continue-on-error: true
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract Branch Name
id: extract-branch
run: |
branch="$(git show -s --format=%s | grep -o "DRIVER_ADAPTERS_BRANCH=[^ ]*" | cut -f2 -d=)"
if [ -n $branch ]; then
echo "Using $branch branch of driver adapters"
echo "DRIVER_ADAPTERS_BRANCH=$branch" >> "$GITHUB_ENV"
fi
- run: make ${{ matrix.adapter.setup_task }}

- uses: dtolnay/rust-toolchain@stable

- name: 'Run tests'
run: cargo test --package query-engine-tests -- --test-threads=1
2 changes: 1 addition & 1 deletion query-engine/connector-test-kit-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ To run tests through a driver adapters, you should also configure the following

* `EXTERNAL_TEST_EXECUTOR`: tells the query engine test kit to use an external process to run the queries, this is a node process running a program that will read the queries to run from STDIN, and return responses to STDOUT. The connector kit follows a protocol over JSON RPC for this communication.
* `DRIVER_ADAPTER`: tells the test executor to use a particular driver adapter. Set to `neon`, `planetscale` or any other supported adapter.
* `DRIVER_ADAPTER_CONFIG`: a json string with the configuration for the driver adapter. This is adapter specific.
* `DRIVER_ADAPTER_CONFIG`: a json string with the configuration for the driver adapter. This is adapter specific. See the [github workflow for driver adapter tests](.github/workflows/query-engine-driver-adapters.yml) for examples on how to configure the driver adapters.

Example:

Expand Down

0 comments on commit 2ef6ee3

Please sign in to comment.