test(memgraph): run the shared suite against Memgraph via a memgraph: false tag #674
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 (TLS) | |
| 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-tls: | |
| name: testkit-tls (${{ matrix.flavor }}) | |
| runs-on: ubuntu-latest | |
| # All flavors are gated: the require-green postprocess step must pass | |
| # for the job (and so the PR) to be green. (Historically informational | |
| # while MRI TLS / the JRuby rows were incubating — both are green now.) | |
| 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 the contract details — same wiring, | |
| # different `--tests` flag below. | |
| 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 short-circuits on the | |
| # first failing suite. The require-green gate runs on the full log, | |
| # so we want every suite to run regardless of an earlier failure. | |
| 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 | |
| # testkit's TLS phase needs the TLS stub server image alongside | |
| # the driver+runner containers; main.py builds it on demand from | |
| # testkit/tlsserver/Dockerfile. | |
| - name: Run testkit TLS suite | |
| id: testkit | |
| continue-on-error: true | |
| run: | | |
| set -o pipefail | |
| cd "$TESTKIT_PATH" | |
| python3 main.py --tests TLS_TESTS 2>&1 | tee "$RUNNER_TEMP/run.log" | |
| - uses: ./.github/actions/testkit-postprocess | |
| id: postprocess | |
| if: always() | |
| with: | |
| target_label: tls | |
| 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-tls-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-tls-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-tls-success` in the ruleset rather than the per-flavor matrix legs. | |
| testkit-tls-success: | |
| name: testkit-tls-success | |
| needs: [testkit-tls] | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Require the testkit-tls matrix to pass | |
| # Bracket notation: a hyphen in the job id is parsed as subtraction | |
| # under dot access (needs.testkit-tls → needs.testkit - tls). | |
| if: ${{ needs['testkit-tls'].result != 'success' }} | |
| run: | | |
| echo "testkit-tls matrix result: ${{ needs['testkit-tls'].result }}" | |
| exit 1 |