test(memgraph): run the shared suite against Memgraph via a memgraph: false tag #1864
This file contains hidden or 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
| name: Testkit | |
| on: | |
| push: | |
| branches: [main] | |
| # Housekeeping-only changes (docs, changelog, version bump) can't affect | |
| # tests — skip the heavy CI on them. A mixed change still runs (paths-ignore | |
| # skips only when EVERY changed file matches). | |
| paths-ignore: ['**/*.md', 'lib/shared/neo4j/driver/version.rb'] | |
| pull_request: | |
| paths-ignore: ['**/*.md', 'lib/shared/neo4j/driver/version.rb'] | |
| jobs: | |
| testkit: | |
| name: testkit (${{ matrix.flavor }}) | |
| runs-on: ubuntu-latest | |
| # All flavors are gated: the require-green postprocess step must pass | |
| # for every flavor for the PR to merge. | |
| # The full testkit config matrix (3 single instances + 7 3-node | |
| # clusters) spends most of its wall-clock on per-config Neo4j | |
| # startup. Cap generously so a hung job can't burn the full | |
| # default 6-hour ceiling, but allow the cluster boots to finish. | |
| timeout-minutes: 90 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - flavor: mri | |
| base_image: ruby:4.0-slim | |
| force_mri: '' | |
| - flavor: jruby | |
| base_image: jruby:10.1.0.0-jdk21 | |
| force_mri: '' | |
| - flavor: mri-on-jruby | |
| base_image: jruby:10.1.0.0-jdk21 | |
| force_mri: '1' | |
| env: | |
| # See testkit-stub.yml for contract details — same wiring. | |
| TEST_DRIVER_NAME: ruby | |
| TEST_DRIVER_REPO: ${{ github.workspace }} | |
| TESTKIT_DRIVER_BUILD_ARG_BASE_IMAGE: ${{ matrix.base_image }} | |
| TESTKIT_DRIVER_BUILD_ARG_NEO4J_DRIVER_FORCE_MRI: ${{ matrix.force_mri }} | |
| # Without this, testkit's run_fail_wrapper re-raises on the first | |
| # config that has any test failure, so main.py never reaches the | |
| # rest of the matrix. We want every config to run so the require-green | |
| # postprocess step sees the whole matrix (green = 0 failures across all). | |
| TEST_RUN_ALL_TESTS: 'true' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Clone pinned testkit | |
| run: | | |
| URI=$(python3 -c "import json; print(json.load(open('testkit/testkit.json'))['testkit']['uri'])") | |
| REF=$(python3 -c "import json; print(json.load(open('testkit/testkit.json'))['testkit']['ref'])") | |
| mkdir -p "$RUNNER_TEMP/testkit" | |
| git -C "$RUNNER_TEMP/testkit" init | |
| git -C "$RUNNER_TEMP/testkit" remote add origin "$URI" | |
| git -C "$RUNNER_TEMP/testkit" fetch --depth 1 origin "$REF" | |
| git -C "$RUNNER_TEMP/testkit" checkout FETCH_HEAD | |
| echo "TESTKIT_PATH=$RUNNER_TEMP/testkit" >> "$GITHUB_ENV" | |
| - name: Install testkit Python deps | |
| run: pip install -Ur "$TESTKIT_PATH/requirements.txt" teamcity-messages | |
| # Run every config that actually boots in CI: 4.4 enterprise | |
| # single instance + 5.1/5.5/5.7/5.9/5.13/5.23/5.26 enterprise | |
| # 3-node clusters. | |
| # | |
| # 4.2 and 4.3 are deliberately excluded. Neo4j 4.2/4.3 enterprise | |
| # never opens bolt 7687 within testkit's wait_for_port window on | |
| # a GH runner (boots in ~5s locally, but the driver-container -> | |
| # neo4jserver:7687 probe never succeeds in CI — root cause still | |
| # open). testkit calls poll_host_and_port_until_available | |
| # directly in main(), OUTSIDE its run_fail_wrapper, so an | |
| # un-bootable config raises CalledProcessError and crashes the | |
| # whole run before any other config executes — even with | |
| # TEST_RUN_ALL_TESTS=true. Listing the bootable configs sidesteps | |
| # that. (The 2026.dev / nightly configs need TEST_IN_TEAMCITY + | |
| # an ECR URL, so they're inert regardless.) | |
| # | |
| # Configs whose required Bolt version the driver can't negotiate | |
| # are still cheap-skipped by tests.neo4j.version_check; the | |
| # require-green gate sums failures across every config, so a | |
| # regression under any one config fails the job. | |
| - name: Run testkit integration suite | |
| id: testkit | |
| continue-on-error: true | |
| run: | | |
| set -o pipefail | |
| cd "$TESTKIT_PATH" | |
| python3 main.py --tests TESTKIT_TESTS \ | |
| --configs \ | |
| 4.4-enterprise-neo4j \ | |
| 5.1-enterprise-cluster-neo4j \ | |
| 5.5-enterprise-cluster-neo4j \ | |
| 5.7-enterprise-cluster-neo4j \ | |
| 5.9-enterprise-cluster-neo4j \ | |
| 5.13-enterprise-cluster-neo4j \ | |
| 5.23-enterprise-cluster-neo4j \ | |
| 5.26-enterprise-cluster-neo4j \ | |
| 2>&1 | tee "$RUNNER_TEMP/run.log" | |
| - uses: ./.github/actions/testkit-postprocess | |
| id: postprocess | |
| if: always() | |
| with: | |
| target_label: integration | |
| log_path: ${{ runner.temp }}/run.log | |
| run_outcome: ${{ steps.testkit.outcome }} | |
| - name: Upload run log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testkit-run-log-${{ matrix.flavor }} | |
| path: ${{ steps.postprocess.outputs.log }} | |
| if-no-files-found: ignore | |
| - name: Upload testkit artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testkit-artifacts-${{ matrix.flavor }} | |
| path: ${{ env.TESTKIT_PATH }}/artifacts/ | |
| if-no-files-found: ignore | |
| # Stable, version-free gate for branch protection (see specs.yml). Require | |
| # `testkit-success` in the ruleset rather than the per-flavor matrix legs. | |
| testkit-success: | |
| name: testkit-success | |
| needs: [testkit] | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require the testkit matrix to pass | |
| if: ${{ needs.testkit.result != 'success' }} | |
| run: | | |
| echo "testkit matrix result: ${{ needs.testkit.result }}" | |
| exit 1 |