Skip to content
Open
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
48 changes: 48 additions & 0 deletions e2e_tests/tests/api/remoteInstances/mongoDb.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import pmmTest from '@fixtures/pmmTest';
import { AddRemoteInstance } from '@api/remoteInstance.api';
import { Timeouts } from '@helpers/timeouts';
import { expect } from '@playwright/test';

pmmTest.describe('Api tests to verify remote mongodb', () => {
const container = 'psmdb-server';
const remoteServiceName = 'psmdb_ssl_remote_upgrade_service';

pmmTest(
'PMM-T948 Verify adding MongoDB SSL services remotely via API before upgrade @pre-upgrade',

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.

🔵 Title is missing the separator: the convention is PMM-Txxxx - description (e2e_tests/CONTRIBUTING.md:70), which every other upgrade test follows, including the existing PMM-T948 one. If this test survives the thread above, make it PMM-T948 - Verify adding ….

async ({ api, cliHelper }) => {
const ca = cliHelper
.execSilent(`docker exec ${container} cat /mongodb_certs/ca-certs.pem`)
.assertSuccess().stdout;
const clientCert = cliHelper
.execSilent(`docker exec ${container} cat /mongodb_certs/client.pem`)
.assertSuccess().stdout;

const data: AddRemoteInstance = {

Check failure on line 20 in e2e_tests/tests/api/remoteInstances/mongoDb.test.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected blank line before this statement

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.

🔴 Lint is red on this head SHA because of this line — Lint run 33617968709:

/home/runner/work/pmm-qa/pmm-qa/e2e_tests/tests/api/remoteInstances/mongoDb.test.ts
  20:7  error  Unexpected blank line before this statement  @stylistic/padding-line-between-statements

The other six errors in that job are pre-existing on the base branch; this one is the PR's. npm run lint -- --fix in e2e_tests clears it.

mongodb: {
add_node: { node_name: 'psmdb_ssl_remote_upgrade_node', node_type: 'NODE_TYPE_REMOTE_NODE' },
address: container,
authentication_mechanism: 'MONGODB-X509',
cluster: 'mongodb_ssl_remote_cluster',
pmm_agent_id: 'pmm-server',
port: '27017',
qan_mongodb_profiler: true,
service_name: remoteServiceName,
tls: true,
tls_ca: ca,
tls_certificate_file_password: '',
tls_certificate_key: clientCert,
tls_skip_verify: true,
},
};

await api.remoteInstanceApi.addRemoteInstance(data);

await expect
.poll(() => api.inventoryApi.verifyAgentsAreRunning(remoteServiceName), {
message: `One or more agents are not running for ${remoteServiceName}`,
timeout: Timeouts.TWO_MINUTES,
})
.toBe(true);
},
);
Comment on lines +10 to +47

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.

🔴 This is a second copy of a test that already exists on the base branch: e2e_tests/tests/upgrade/ssl.test.ts:11 is PMM-T948 + PMM-T947 - Verify Adding MongoDB SSL service remotely via API before upgrade @pre-upgrade, with the same psmdb-server container, the same MONGODB-X509 payload, the same cluster name and the same verifyAgentsAreRunning poll — only the CA lookup and the service name differ.

Both are tagged @pre-upgrade, so upgrade-pmm-runner.yml:205 (--grep "@pre-upgrade") now registers two remote MongoDB SSL services and runs PMM-T948 twice, and the Zephyr case reports against two results. The new service psmdb_ssl_remote_upgrade_service also has no post-upgrade counterpart — ssl.test.ts:50 only verifies metrics for remote_api_psmdb-server — so it adds pre-upgrade work that nothing checks afterwards.

The head commit message says "Fix MongoDB SSL remote API test (PMM-T948)", and reading the CA from docker exec … cat /mongodb_certs/ca-certs.pem instead of find / -name "ca.crt" (ssl.test.ts:16-21) is that fix. Apply it in place in ssl.test.ts and drop this file.

});
Loading