Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/upgrade-pmm-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ jobs:

- name: Post-client-upgrade UI tests
working-directory: pmm-qa/e2e_tests
env:
PMM_SERVER_LATEST: ${{ steps.resolve.outputs.PMM_SERVER_LATEST }}
run: npx playwright test --grep "@post-upgrade|@rta"

- name: Check packages after upgrade
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/tests/inventory/services.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pmmTest.beforeEach(async ({ grafanaHelper, page, servicesPage }) => {
pmmTest(
'PMM-T2159 - Verify MongoDB RTA Agent displayed in Inventory UI @rta',
async ({ agentsPage, api, servicesPage }) => {
const service = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Switching to getServiceDetailsByRegex drops the "service is not present" error, because that path's guard is broken: getAllServiceDetailsByRegex (e2e_tests/api/inventory.api.ts:14) checks if (!service) on the result of .filter(), and an empty array is truthy — so it never throws and getServiceDetailsByRegex returns undefined.

getServiceDetailsByPartialName used .find() and did throw Service with name rs101 is not present. After this change, an environment where the mongo services never registered fails with TypeError: Cannot read properties of undefined (reading 'service_id') on the next line instead — exactly the failure mode this PR is trying to diagnose in the post-client-upgrade step, now with a worse message. Same for the other seven call sites in this PR.

Fix the guard in inventory.api.ts (if (!service.length) throw ...) as part of this PR, since the diff is what makes the RTA tests depend on it.


await api.realTimeAnalyticsApi.startRealTimeAnalytics(service.service_id);
await servicesPage.builders.monitoringStatusByServiceName(service.service_name).click();
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/tests/qan/rta/autoRefresh.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Timeouts } from '@helpers/timeouts';
pmmTest.beforeEach(async ({ api, grafanaHelper, page, realTimeAnalyticsPage }) => {
await grafanaHelper.authorize();

const service = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');

await api.realTimeAnalyticsApi.startRealTimeAnalytics(service.service_id);
await page.goto(realTimeAnalyticsPage.getUrlWithServices([service.service_id]));
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/tests/qan/rta/details.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect } from '@playwright/test';
pmmTest.beforeEach(async ({ api, grafanaHelper, page, queryAnalytics }) => {
await grafanaHelper.authorize();

const service = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');

await api.realTimeAnalyticsApi.startRealTimeAnalytics(service.service_id);
await page.goto(queryAnalytics.rta.getUrlWithServices([service.service_id]));
Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/tests/qan/rta/general.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Timeouts } from '@helpers/timeouts';
pmmTest.beforeEach(async ({ api, grafanaHelper, page, queryAnalytics }) => {
await grafanaHelper.authorize();

const service = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');

await api.realTimeAnalyticsApi.startRealTimeAnalytics(service.service_id);
await page.goto(queryAnalytics.rta.getUrlWithServices([service.service_id]));
Expand Down
4 changes: 2 additions & 2 deletions e2e_tests/tests/qan/rta/overview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let sortedHostNames: string[];
pmmTest.beforeEach(async ({ api, grafanaHelper, page, queryAnalytics }) => {
await grafanaHelper.authorize();

const service1 = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service2 = await api.inventoryApi.getServiceDetailsByPartialName('rs102');
const service1 = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');
const service2 = await api.inventoryApi.getServiceDetailsByRegex('^rs102_');
Comment on lines +11 to +12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 ^rs101_ and includes('rs101') select the same service in every runner that greps @rta, so this rename cannot be what fixes the post-client-upgrade RTA failure the commit message claims.

The service name is always ${node}_${random_number}rs101_31226 from configure-agents.sh:61 (fb-e2e-suite.yml --database psmdb), rs101_gssapi_31226 when GSSAPI=true (gssapi-psmdb-tests-matrix.yml), rs101_31226 from start-sharded.sh:329 (upgrade-pmm-runner.yml SETUP_TYPE=sharding). Nothing else in any of those inventories contains the substring rs101, and .find() and .filter()[0] both take the first match of the same array, so the eight changed call sites resolve identically before and after.

The env var added to the post-client-upgrade step is the change that does something — upgradePMM.test.ts:7 throws without PMM_SERVER_LATEST. Drop the lookup rename (or land it separately with its own reason) so the fix is reviewable on its own.


sortedHostNames = [service1.service_name, service2.service_name].sort();

Expand Down
2 changes: 1 addition & 1 deletion e2e_tests/tests/qan/rta/redirection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pmmTest.beforeEach(async ({ grafanaHelper, page }) => {
pmmTest(
'PMM-T2195 Verify user is redirected to Sessions page when sessions are running @rta',
async ({ api, helpPage, page, queryAnalytics, realTimeAnalyticsPage }) => {
const service = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');

await api.realTimeAnalyticsApi.startRealTimeAnalytics(service.service_id);

Expand Down
4 changes: 2 additions & 2 deletions e2e_tests/tests/qan/rta/session.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ let rs102ServiceId: string;
pmmTest.beforeEach(async ({ api, grafanaHelper }) => {
await grafanaHelper.authorize();

const service1 = await api.inventoryApi.getServiceDetailsByPartialName('rs101');
const service2 = await api.inventoryApi.getServiceDetailsByPartialName('rs102');
const service1 = await api.inventoryApi.getServiceDetailsByRegex('^rs101_');
const service2 = await api.inventoryApi.getServiceDetailsByRegex('^rs102_');

rs101ServiceId = service1.service_id;
rs102ServiceId = service2.service_id;
Expand Down
Loading