Add QAN URL state persistence tests - #1139
Conversation
Add comprehensive tests for URL state persistence across RTA overview, sessions, and stored metrics pages. Includes new page object methods and locators for filters, pagination, and rows-per-page controls. Adds mock helper for RTA sessions and new storedMetrics URL state test suite (PMM-T2265, PMM-T2266, PMM-T2267, PMM-T2268).
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughChangesURL State Coverage
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
e2e_tests/tests/qan/storedMetrics/urlState.test.ts (1)
17-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSplit the scenario into
test.step()phases.Separate filter changes, pagination changes, URL assertions, and shared-URL restoration into named steps. This makes a failed URL-state assertion identifiable in CI output.
As per coding guidelines, “Use Playwright's
test.step()for readable test structure.”🤖 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/qan/storedMetrics/urlState.test.ts` around lines 17 - 68, Split the scenario in the test callback into named Playwright test.step phases covering filter changes, pagination changes, URL assertions, and shared-URL restoration. Move the corresponding existing actions and assertions into these steps without changing their order or behavior, and keep console-error collection and cleanup correctly scoped across the full scenario.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/qan/rta/overview.test.ts`:
- Around line 262-274: Select a known service in the test before capturing
serviceIds, using the existing service-selection control or helper. Assert that
the pre-reload URL contains the selected service ID, then preserve the existing
reload flow and verify the post-reload serviceIds matches the captured value.
- Around line 245-275: Add readable pmmTest.step() blocks to structure the
URL-state tests: in e2e_tests/tests/qan/rta/overview.test.ts lines 245-275,
separate state setup, URL verification, reload, and restored-state checks; in
lines 278-331, separate duration setup, filtered-results verification, URL
verification, and restoration checks; in e2e_tests/tests/qan/rta/session.test.ts
lines 55-72, separate mock setup, page-size selection, URL verification, and
reload checks.
In `@e2e_tests/tests/qan/storedMetrics/urlState.test.ts`:
- Line 16: Add the `@qan` tag to the test title for “PMM-T2268 Verify QAN shared
URL restores filters and pagination,” while retaining the existing `@rta` tag.
- Line 26: Wrap the test body after the page setup and console listener
registration in a try/finally block. Keep the existing assertions and test flow
in try, and move page.off('console', collectErrors) plus sharedPage.close() into
finally so both cleanup operations run on success and failure.
---
Nitpick comments:
In `@e2e_tests/tests/qan/storedMetrics/urlState.test.ts`:
- Around line 17-68: Split the scenario in the test callback into named
Playwright test.step phases covering filter changes, pagination changes, URL
assertions, and shared-URL restoration. Move the corresponding existing actions
and assertions into these steps without changing their order or behavior, and
keep console-error collection and cleanup correctly scoped across the full
scenario.
🪄 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: 31dd7321-b48b-4220-a07f-0ac1c7967a38
📒 Files selected for processing (7)
e2e_tests/helpers/apiEndpoints.tse2e_tests/helpers/mocks.helper.tse2e_tests/pages/qan/rta/realTimeAnalytics.page.tse2e_tests/pages/qan/storedMetrics/storedMetrics.page.tse2e_tests/tests/qan/rta/overview.test.tse2e_tests/tests/qan/rta/session.test.tse2e_tests/tests/qan/storedMetrics/urlState.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
percona/pmm-qa(manual)percona/pmm(manual)
PMM-T2268 (added in #1139) exercises the useTableUrlState / debounced-search feature from PMM-14848 (percona/pmm#5537), merged to main on 2026-08-11 and shipping in 3.10.0. Like its sibling specs T2265-T2267 it fails against pre-3.10.0 RC images, so add it to the central version registry. Signed-off-by: Claude <noreply@anthropic.com>
…1184) * Resolve RC client version from server_version, not v3 VERSION The Generic CLI suite resolved the expected pmm-admin version for a `pmm3-rc` client by curl-ing Percona-Lab/pmm-submodules v3 VERSION. The moment an RC branches, that file is bumped to the next dev version, so during RC testing the client reports 3.9.0 while the test expects 3.9.1 -> every Generic leg failed on `pmm-admin --version` / `summary --version`. Resolve the expected version from `pmm-admin status --json` (server_version) for `pmm3-rc` too, reusing the existing feature-build path, so the reference tracks the artifact under test rather than the moving v3 line. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Gate MongoDB Unused Indexes dashboard test to PMM 3.10.0+ The Unused Indexes dashboard ships from PMM Server 3.10.0, but the rc-testing-suite runs pmm-qa main against older RC images (e.g. 3.9.0-rc), where the dashboard/nav item does not exist, so PMM-T2262 fails with "element(s) not found". Add a small server-version gate (read from DOCKER_VERSION) and skip the spec when the server predates 3.10.0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Gate 3.10.0-only e2e specs against older RC images These specs cover features that ship from PMM Server 3.10.0 and are absent in 3.9.x (incl. the 3.9.1 patch RC), so they fail when the rc-testing-suite runs pmm-qa main against a 3.9.x image: - RTA table/session URL-state persistence (PMM-T2265/T2266/T2267) — useTableUrlState, percona/pmm#5537 - Update-notification snooze (PMM-T2263) — percona/pmm#5694 - Left-menu traversal expecting the 3.10 mongo-unused-indexes nav item (PMM-T2202) Skip each via the shared serverVersionBelow('3.10.0') gate; they keep running on 3.10.0+ dev/RC builds. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Fix PMM-T2227 tarball-upgrade version assertion #1175 made the post-upgrade check assert PMM_VERSION, which for the compatibility legs is the pinned matrix.version (e.g. 3.7.0) — but the test always upgrades to pmm-client-latest.tar.gz (dev HEAD, e.g. 3.9.1-v3), so every compat Generic leg failed asserting the old pinned version. Assert against the version the upgrade tarball actually installs instead: verify the reported version changed (upgrade happened) and, for the default dev-latest tarball, that it matches the build under test (v3 VERSION). This keeps the exact-version coverage without tying it to the leg's source version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Inline version gate helper and trim comments Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Fail closed when the upgrade version lookup fails If the curl to v3 VERSION failed or returned empty, upgradedVersion was '' and the exact-version assertion was silently skipped, letting the test pass on any changed version. Require a successful, non-empty lookup instead. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Detect PMM version from the server API, not DOCKER_VERSION DOCKER_VERSION is not always set, so the version gate could not tell which build was under test. Add ServerApi.getPmmVersion() (GET /v1/version) as in #1094 and reduce the helper to a pure semver comparison; the 3.10.0 gates now read the running server's version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Gate version-specific specs with a min-pmm-version annotation Move the 3.10.0 skip logic out of each test body into a single pmmTest.beforeEach that reads a `min-pmm-version` annotation and skips when the running server (GET /v1/version) is below it. Tests now only declare the version they need; no per-test skip code or fixture plumbing, and nothing to edit when a version ships. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Move version gates to a central registry, off the tests Keep the runtime server-version gate but drive it from a single versionGates map (PMM-T id -> min version) resolved in pmmTest.beforeEach. The specs themselves carry nothing: gate or retire one by editing one line in the registry. Being a runtime gate, the same spec skips on an older server and runs on 3.10.0+, so it stays correct across concurrent patch/minor branches with no per-branch edits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012DpJQhfD6qKwZWwsiP671T Signed-off-by: Claude <noreply@anthropic.com> * Gate PMM-T2268 QAN URL-state test to PMM 3.10.0+ PMM-T2268 (added in #1139) exercises the useTableUrlState / debounced-search feature from PMM-14848 (percona/pmm#5537), merged to main on 2026-08-11 and shipping in 3.10.0. Like its sibling specs T2265-T2267 it fails against pre-3.10.0 RC images, so add it to the central version registry. Signed-off-by: Claude <noreply@anthropic.com> --------- Signed-off-by: Claude <noreply@anthropic.com> Co-authored-by: Claude <noreply@anthropic.com>
Add comprehensive tests for URL state persistence across RTA overview, sessions, and stored metrics pages. Includes new page object methods and locators for filters, pagination, and rows-per-page controls. Adds mock helper for RTA sessions and new storedMetrics URL state test suite (PMM-T2265, PMM-T2266, PMM-T2267, PMM-T2268).
https://github.com/percona/pmm-qa/actions/runs/31022412293/job/92362695351