From 10765095ea37b284889a6b2408c97b31a5a38d31 Mon Sep 17 00:00:00 2001 From: Serhii Tatarintsev Date: Thu, 11 Jul 2024 18:47:40 +0200 Subject: [PATCH] Split qe test job into multiple jobs because FML --- .../test-query-engine-cockroachdb.yml | 38 ++++++++++ .../workflows/test-query-engine-mongodb.yml | 40 ++++++++++ .github/workflows/test-query-engine-mssql.yml | 38 ++++++++++ .github/workflows/test-query-engine-mysql.yml | 40 ++++++++++ .../workflows/test-query-engine-postgres.yml | 48 ++++++++++++ .../workflows/test-query-engine-sqlite.yml | 28 +++++++ .../workflows/test-query-engine-template.yml | 76 +++++++++++++++++++ 7 files changed, 308 insertions(+) create mode 100644 .github/workflows/test-query-engine-cockroachdb.yml create mode 100644 .github/workflows/test-query-engine-mongodb.yml create mode 100644 .github/workflows/test-query-engine-mssql.yml create mode 100644 .github/workflows/test-query-engine-mysql.yml create mode 100644 .github/workflows/test-query-engine-postgres.yml create mode 100644 .github/workflows/test-query-engine-sqlite.yml create mode 100644 .github/workflows/test-query-engine-template.yml diff --git a/.github/workflows/test-query-engine-cockroachdb.yml b/.github/workflows/test-query-engine-cockroachdb.yml new file mode 100644 index 000000000000..5297897e7c8d --- /dev/null +++ b/.github/workflows/test-query-engine-cockroachdb.yml @@ -0,0 +1,38 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + strategy: + fail-fast: false + matrix: + database: + - name: "cockroach_23_1" + connector: "cockroachdb" + version: "23.1" + - name: "cockroach_22_2" + version: "22.2" + - name: "cockroach_22_1_0" + version: "22.1" + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: ${{ matrix.database.name }} + version: ${{ matrix.database.version }} + connector: 'cockroachdb' \ No newline at end of file diff --git a/.github/workflows/test-query-engine-mongodb.yml b/.github/workflows/test-query-engine-mongodb.yml new file mode 100644 index 000000000000..be33f4529ac8 --- /dev/null +++ b/.github/workflows/test-query-engine-mongodb.yml @@ -0,0 +1,40 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + strategy: + fail-fast: false + matrix: + database: + - name: "mongodb_4_2" + version: "4.2" + - name: "mongodb_4_4" + version: "4.4" + - name: "mongodb_5" + connector: "mongodb" + version: "5" + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: ${{ matrix.database.name }} + version: ${{ matrix.database.version }} + single_threaded: true + connector: 'mongodb' + relation_load_strategy: '["query"]' \ No newline at end of file diff --git a/.github/workflows/test-query-engine-mssql.yml b/.github/workflows/test-query-engine-mssql.yml new file mode 100644 index 000000000000..2ba453c05e97 --- /dev/null +++ b/.github/workflows/test-query-engine-mssql.yml @@ -0,0 +1,38 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + strategy: + fail-fast: false + matrix: + database: + - name: "mssql_2022" + version: "2022" + - name: "mssql_2019" + version: "2019" + - name: "mssql_2017" + version: "2017" + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: ${{ matrix.database.name }} + version: ${{ matrix.database.version }} + connector: 'sqlserver' + relation_load_strategy: '["query"]' \ No newline at end of file diff --git a/.github/workflows/test-query-engine-mysql.yml b/.github/workflows/test-query-engine-mysql.yml new file mode 100644 index 000000000000..728012308955 --- /dev/null +++ b/.github/workflows/test-query-engine-mysql.yml @@ -0,0 +1,40 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + strategy: + fail-fast: false + matrix: + database: + - name: "mysql_5_6" + version: "5.6" + - name: "mysql_5_7" + version: "5.7" + - name: "mysql_8" + version: "8" + - name: "mysql_mariadb" + version: "mariadb" + + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: ${{ matrix.database.name }} + version: ${{ matrix.database.version }} + connector: 'mysql' \ No newline at end of file diff --git a/.github/workflows/test-query-engine-postgres.yml b/.github/workflows/test-query-engine-postgres.yml new file mode 100644 index 000000000000..f58d5c490c0d --- /dev/null +++ b/.github/workflows/test-query-engine-postgres.yml @@ -0,0 +1,48 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + strategy: + fail-fast: false + matrix: + database: + - name: "postgres16" + version: "16" + - name: "postgres15" + version: "15" + - name: "postgres14" + version: "14" + - name: "postgres13" + version: "13" + - name: "postgres12" + version: "12" + - name: "postgres11" + version: "11" + - name: "postgres10" + version: "10" + - name: "postgres9" + version: "9" + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: ${{ matrix.database.name }} + version: ${{ matrix.database.version }} + connector: 'postgres' + single_threaded: true \ No newline at end of file diff --git a/.github/workflows/test-query-engine-sqlite.yml b/.github/workflows/test-query-engine-sqlite.yml new file mode 100644 index 000000000000..b0d70a4dabd8 --- /dev/null +++ b/.github/workflows/test-query-engine-sqlite.yml @@ -0,0 +1,28 @@ +name: "QE: postgres" +on: + push: + branches: + - main + pull_request: + paths-ignore: + - "!.github/workflows/test-query-engine.yml" + - ".github/**" + - ".buildkite/**" + - "*.md" + - "LICENSE" + - "CODEOWNERS" + - "renovate.json" + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + qe-tests: + uses: ./.github/workflows/test-query-engine-template.yml + with: + name: 'sqlite' + version: 3 + connector: 'sqlite' + relation_load_strategy: '["query"]' \ No newline at end of file diff --git a/.github/workflows/test-query-engine-template.yml b/.github/workflows/test-query-engine-template.yml new file mode 100644 index 000000000000..a11c19bc33ed --- /dev/null +++ b/.github/workflows/test-query-engine-template.yml @@ -0,0 +1,76 @@ +name: "QE: integration template" +on: + workflow_call: + inputs: + name: + type: string + required: true + connector: + type: string + required: true + version: + type: string + required: true + single_threaded: + type: boolean + default: false + relation_load_strategy: + type: string + default: '["join", "query"]' + + +jobs: + rust-query-engine-tests: + name: "${{ inputs.name }} - ${{ matrix.engine_protocol }} ${{ matrix.relation_load_strategy }} ${{ matrix.partition }}" + + strategy: + fail-fast: false + matrix: + engine_protocol: [graphql, json] + relation_load_strategy: ${{ fromJson(inputs.relation_load_strategy) }} + partition: ["1/4", "2/4", "3/4", "4/4"] + + env: + LOG_LEVEL: "info" + LOG_QUERIES: "y" + RUST_LOG_FORMAT: "devel" + RUST_BACKTRACE: "1" + CLICOLOR_FORCE: "1" + CLOSED_TX_CLEANUP: "2" + SIMPLE_TEST_MODE: "1" + QUERY_BATCH_SIZE: "10" + TEST_RUNNER: "direct" + TEST_CONNECTOR: ${{ inputs.connector }} + TEST_CONNECTOR_VERSION: ${{ inputs.version }} + PRISMA_ENGINE_PROTOCOL: ${{ matrix.engine_protocol }} + PRISMA_RELATION_LOAD_STRATEGY: ${{ matrix.relation_load_strategy }} + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: taiki-e/install-action@nextest + + - name: Login to Docker Hub + uses: docker/login-action@v3 + continue-on-error: true + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} + if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}" + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: "Start ${{ inputs.name }} (${{ matrix.engine_protocol }})" + run: make start-${{ inputs.name }} + + - run: export WORKSPACE_ROOT=$(pwd) && cargo nextest run -p query-engine-tests --partition hash:${{ matrix.partition }} --test-threads=1 + if: ${{ inputs.single_threaded }} + env: + CLICOLOR_FORCE: 1 + + - run: export WORKSPACE_ROOT=$(pwd) && cargo nextest run -p query-engine-tests --partition hash:${{ matrix.partition }} --test-threads=8 + if: ${{ !inputs.single_threaded }} + env: + CLICOLOR_FORCE: 1