Skip to content

feat(nx-ci): add test_integration input + grant PROCESS to MySQL test user#31

Merged
AndriiTsok merged 1 commit intomainfrom
feat/nx-ci-test-integration
Apr 20, 2026
Merged

feat(nx-ci): add test_integration input + grant PROCESS to MySQL test user#31
AndriiTsok merged 1 commit intomainfrom
feat/nx-ci-test-integration

Conversation

@AndriiTsok
Copy link
Copy Markdown
Contributor

Summary

Two related changes that let workspaces move per-plugin integration workflows (mcpg-dev/source-code's `sql-integration.yml` is the motivating example) back onto nx-ci.yml alongside lint/test/build — gated on CD branches where integration suites should run.

1. `nx-ci.yml`: `test_integration: bool` input

  • Default `false`. When `true`, runs `pnpm nx <affected|run-many> -t test:integration` after the `test` step.
  • Projects without a `test:integration` target are skipped by Nx — safe to run across mixed workspaces.
  • Caller gates it on the branch condition it cares about (push to main/develop/next, PR base in that set, etc.).
  • Services the integration suites need stay gated via existing `environment_skip` / `.environment.yml` inputs.

2. `environment-setup`: grant `PROCESS` on . to `mcpg` MySQL user

MySQL 8 requires the server-wide `PROCESS` privilege for `KILL QUERY` across sessions. mcpg-dev's sql-binding cancellation tests exercise exactly that path. Grant is scoped to the same `mcpg`@`127.0.0.1` / `mcpg`@`localhost` users we already create for the test DB.

Downstream impact

  • Nothing breaks: `test_integration` defaults off; PROCESS grant is additive to an already-created test user.
  • Once this ships (bump to `v1.8.0`), mcpg-dev can:
    • Set `test_integration: ${{ condition }}` in its continuous-integration caller.
    • Delete `sql-integration.yml` and the plugin-level PROCESS-grant shell step.

Test plan

  • CI on this PR passes.
  • After merge, tag `v1.8.0` so the `@v1` alias picks up the new input.
  • mcpg-dev/source-code caller flip + sql-integration.yml deletion PR succeeds end-to-end.

… user

Two related changes that together let a workspace move its integration
test lane off a dedicated per-plugin workflow (like mcpg-dev's
sql-integration.yml) and back onto nx-ci.yml alongside lint / test /
build.

nx-ci.yml — new `test_integration: bool` input (default false). When
true, runs `pnpm nx <affected|run-many> -t test:integration` after the
main `test` step. Projects that don't declare the target are skipped
silently by Nx. Intended for CD-gated lanes where callers flip this on
for merges / PRs targeting core branches (main / develop / next).

environment-setup — grant PROCESS on *.* to the mcpg MySQL test user
alongside the existing database-scoped GRANT ALL. MySQL 8 requires
PROCESS for `KILL QUERY` across sessions, which the sql-binding
integration tests exercise when validating cancellation. Safe on an
ephemeral CI database that only the test user touches.

Callers that want the CD-gated integration lane can now drop their
dedicated workflow, toggle `test_integration: true` + flip
`environment_skip` to include services, and rely on the same
reusable workflow path as every other target.
@AndriiTsok AndriiTsok merged commit cdc7529 into main Apr 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant