Conversation
Adds Playwright coverage for the Performance Schema Memory panels introduced in percona/pmm#5649 (perf_schema.memory_events collector): - New page object MysqlPerformanceSchemaDetails for the MySQL Performance Schema Details dashboard (uid mysql-performance-schema), including the three memory panels and the full panel inventory. - Registers it in the MySQL dashboards index. - New @pmm-ps-integration scenario: asserts the memory panels are present and that the Current Bytes Used panel renders real data end-to-end (collector -> VictoriaMetrics -> panel).
WalkthroughThe change adds the MySQL Performance Schema Details dashboard page model, registers it in ChangesMySQL Performance Schema coverage
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts (1)
193-212: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd explicit
pmmTest.step()blocks.Wrap navigation, panel-presence validation, and data validation in separate
pmmTest.step()calls. This makes the test report identify the failed operation.Proposed structure
+ await pmmTest.step('Open the Performance Schema Details dashboard', async () => { await page.goto( urlHelper.buildUrlWithParameters(dashboard.mysql.mysqlPerformanceSchemaDetails.url, { from: 'now-15m', refresh: '5s', serviceName: service_name, }), ); + }); + await pmmTest.step('Verify Performance Schema Memory panels', async () => { await dashboard.verifyMetricsPresent(dashboard.mysql.mysqlPerformanceSchemaDetails.memoryMetrics); + }); + await pmmTest.step('Verify Current Bytes Used panel data', async () => { await dashboard.verifyNamedPanelsHaveData([ dashboard.mysql.mysqlPerformanceSchemaDetails.memoryCurrentUsedPanel, ]); + });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts` around lines 193 - 212, Update the dashboard test callback to wrap navigation, metric/panel presence validation, and panel data validation in separate pmmTest.step() blocks. Keep the existing url construction and verification calls unchanged, assigning each block a descriptive step name so reports identify which operation failed.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts`:
- Around line 190-192: Update the test title in pmmTest for PMM-12279 by
replacing the PMM-T0000 placeholder with the reserved Zephyr test-case ID. Keep
the rest of the title and test behavior unchanged.
- Line 194: Update the service selection around getServiceDetailsByRegex to
choose or validate a MySQL 8.0+ service configured with query-source=perfschema,
rather than relying on the ambiguous ps_pmm match. Ensure the selected service
has the required collector configuration before performing the memory-panel
checks.
---
Nitpick comments:
In `@e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts`:
- Around line 193-212: Update the dashboard test callback to wrap navigation,
metric/panel presence validation, and panel data validation in separate
pmmTest.step() blocks. Keep the existing url construction and verification calls
unchanged, assigning each block a descriptive step name so reports identify
which operation failed.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0cb804dd-8977-4669-b461-c7ca27373447
📒 Files selected for processing (3)
e2e_tests/pages/dashboards/mysql/index.tse2e_tests/pages/dashboards/mysql/mysqlPerformanceSchemaDetails.tse2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
percona/pmm-qa(manual)percona/pmm(manual) → reviewed against open PR#5649PMM-12279instead of the default branch
| // TODO: replace PMM-T0000 with the Zephyr test-case id reserved for PMM-12279. | ||
| pmmTest( | ||
| 'PMM-T0000 - Verify Performance Schema Memory panels on MySQL Performance Schema Details Dashboard (PMM-12279) @pmm-ps-integration', |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Replace the placeholder Zephyr ID before merge.
PMM-T0000 does not provide test-case traceability. Replace it with the reserved Zephyr ID.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts` around lines 190 -
192, Update the test title in pmmTest for PMM-12279 by replacing the PMM-T0000
placeholder with the reserved Zephyr test-case ID. Keep the rest of the title
and test behavior unchanged.
| pmmTest( | ||
| 'PMM-T0000 - Verify Performance Schema Memory panels on MySQL Performance Schema Details Dashboard (PMM-12279) @pmm-ps-integration', | ||
| async ({ api, dashboard, page, urlHelper }) => { | ||
| const { service_name } = await api.inventoryApi.getServiceDetailsByRegex('ps_pmm'); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -i -C 4 \
'ps_pmm|query[-_]?source.*perfschema|perfschema.*query[-_]?source|mysql.*8(\.0)?' \
. -g '!node_modules/**' -g '!dist/**' -g '!build/**'Repository: percona/pmm-qa
Length of output: 50371
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- target test ---'
sed -n '150,225p' e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts
printf '%s\n' '--- service selector implementation and usages ---'
rg -n -C 6 'getServiceDetailsByRegex|ps_pmm' e2e_tests --glob '*.ts' --glob '*.yml'
printf '%s\n' '--- environment/setup references for the default ps_pmm service ---'
rg -n -i -C 5 'mysql_service_name|service_name.*ps|ps[_-]pmm|mysql_version|query-source=perfschema' \
qa-integration package_tests e2e_tests --glob '*.yml' --glob '*.yaml' --glob '*.ts' --glob '*.sh' \
| head -n 500Repository: percona/pmm-qa
Length of output: 50370
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- Percona Server setup ---'
sed -n '1,240p' qa-integration/pmm_qa/percona_server_for_mysql/percona-server-setup.yml
printf '%s\n' '--- Percona Server setup files and version/service-name definitions ---'
rg -n -C 4 'ps_version|query_source|service_name|pmm-admin add mysql|container_prefix|mysql_version' \
qa-integration/pmm_qa/percona_server_for_mysql \
qa-integration/pmm_qa --glob '*.yml' --glob '*.yaml' --glob '*.j2' --glob '*.sh' \
| head -n 800
printf '%s\n' '--- test configuration and database matrix ---'
rg -n -i -C 4 'pmm-ps-integration|percona.*mysql|ps_version|QUERY_SOURCE|SETUP_TYPE|mysql.*8.0|mysql.*5.7' \
e2e_tests package.json playwright.config.* qa-integration --glob '*.ts' --glob '*.js' --glob '*.json' \
--glob '*.yml' --glob '*.yaml' --glob '*.env*' --glob '*.sh' \
| head -n 800Repository: percona/pmm-qa
Length of output: 50371
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- callers of the Percona Server setup ---'
rg -n -C 6 'percona-server-setup\.yml|percona_server_for_mysql|PS_VERSION|QUERY_SOURCE|SETUP_TYPE' \
.github qa-integration scripts Makefile* package.json 2>/dev/null \
| head -n 1000
printf '%s\n' '--- all setup entry points and workflow environment ---'
git ls-files | rg '(^|/)(workflows|.*workflow.*|.*setup.*|.*config.*)' \
| rg -i 'ya?ml$|json$|sh$|ts$|js$' \
| head -n 300
printf '%s\n' '--- exact collector prerequisite references ---'
rg -n -i -C 6 'memory_events|perf_schema.*memory|memory.*perf_schema|query.?source|8\.0\+' \
e2e_tests qa-integration .github --glob '*.ts' --glob '*.yml' --glob '*.yaml' --glob '*.sh' \
| head -n 1000Repository: percona/pmm-qa
Length of output: 50370
🏁 Script executed:
set -euo pipefail
printf '%s\n' '--- PS framework registration and argument forwarding ---'
sed -n '1,150p' qa-integration/pmm_qa/pmm-framework/lib/config.sh
rg -n -C 8 'PS\b|PS_VERSION|QUERY_SOURCE|database.*ps|ansible.*percona|percona-server-setup' \
qa-integration/pmm_qa/pmm-framework \
qa-integration/pmm_qa/scripts \
.github/workflows/runner-e2e-tests-playwright.yml \
| head -n 1000
printf '%s\n' '--- inventory response shape and service fields ---'
sed -n '1,120p' e2e_tests/api/inventory.api.ts
rg -n -C 4 'interface GetService|type GetService|query.?source|query_source|service_type|service_name' \
e2e_tests --glob '*.ts' | head -n 600
printf '%s\n' '--- deterministic setup/selector verifier ---'
python3 - <<'PY'
from pathlib import Path
import re
setup = Path("qa-integration/pmm_qa/percona_server_for_mysql/percona-server-setup.yml").read_text()
workflow = Path(".github/workflows/fb-e2e-suite.yml").read_text()
test = Path("e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts").read_text()
assert "getServiceDetailsByRegex('ps_pmm')" in test
assert "SETUP_TYPE=replication" in workflow
assert "SETUP_TYPE=gr,QUERY_SOURCE=slowlog" in workflow
prefix = "ps_pmm{suffix}_{version}_"
for setup_type, query_source in [("replication", "perfschema"), ("gr", "slowlog")]:
suffix = f"_{setup_type}"
name = prefix.format(suffix=suffix, version="8_0") + "1_12345"
assert re.search(r"ps_pmm", name)
print(f"{name}: query_source={query_source}, matches ps_pmm=True")
print("The workflow creates both a perfschema service and a slowlog service.")
print("The test regex matches both service-name families.")
print("The selector does not constrain query_source or MySQL version.")
PYRepository: percona/pmm-qa
Length of output: 50373
Select a service with the required collector configuration.
getServiceDetailsByRegex('ps_pmm') can select the group-replication service configured with slowlog, or a MySQL 5.7 service. Select or validate a MySQL 8.0+ service configured with query-source=perfschema before checking the memory panels.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@e2e_tests/tests/dashboards/mysql/mysqlDashboards.test.ts` at line 194, Update
the service selection around getServiceDetailsByRegex to choose or validate a
MySQL 8.0+ service configured with query-source=perfschema, rather than relying
on the ambiguous ps_pmm match. Ensure the selected service has the required
collector configuration before performing the memory-panel checks.
What
Adds Playwright (
e2e_tests/) coverage for the Performance Schema Memory panels introduced in percona/pmm#5649, which enables theperf_schema.memory_eventscollector and adds memory panels to the MySQL Performance Schema Details dashboard.Jira: PMM-12279
Changes
pages/dashboards/mysql/mysqlPerformanceSchemaDetails.tsfor the MySQL Performance Schema Details dashboard (uidmysql-performance-schema). Includes the full panel inventory plus amemoryMetricssubset for the three new panels. The dashboard previously had no e2e coverage.pages/dashboards/mysql/index.ts.tests/dashboards/mysql/mysqlDashboards.test.ts(tag@pmm-ps-integration):How to test
Requires a PMM environment with a Percona Server / MySQL 8.0+ service added with
--query-source=perfschema(theps_pmmservice in the@pmm-ps-integrationsetup). Memory instruments are enabled by default on PS/MySQL 8.0+, so the Current Bytes Used panel is populated without extra server config.Notes / follow-ups
PMM-T0000(marked with aTODO). Needs to be replaced with the reserved test-case id before merge.rate(...) > 0, so they can legitimately be empty under idle load. They are allow-listed innoDataMetrics; the test asserts data only on the always-populated Current Bytes Used panel to avoid flakiness.qa-integrationprovisioning changes were needed. Enablingperformance-schema-instrument='memory/%=ON'on the test server (to also exercise the rate panels) can be a later hardening step.Depends on percona/pmm#5649 being merged for the panels to exist in the shipped dashboard.
🤖 Generated with Claude Code