-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f2e280
commit f55256f
Showing
3 changed files
with
78 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { test } from '@playwright/test'; | ||
import * as cli from '@helpers/cliHelper'; | ||
|
||
test.describe('PMM Client Docker CLI tests', async () => { | ||
|
@@ -75,16 +75,35 @@ test.describe('PMM Client Docker CLI tests', async () => { | |
await output.outContains('Service removed.'); | ||
}); | ||
|
||
test('@PMM-T1664 Verify vm_agents default value of -promscrape.maxScapeSize', async ({page}) => { | ||
const expectedScrapeSize = '64'; | ||
test.only('@PMM-T1664 @PMM-T1665 Verify vm_agents -promscrape.maxScapeSize parameter', async ({page}) => { | ||
const defaultScrapeSize = '64'; | ||
const customScrapeSize = '128'; | ||
|
||
await (await cli.exec(`docker-compose -f test-setup/docker-compose-scrape-intervals.yml up -d`)).assertSuccess(); | ||
await (await cli.exec('sudo pmm-admin config --force \'--server-url=https://admin:[email protected]:1443\' --server-insecure-tls 127.0.0.1')).assertSuccess() | ||
await test.step('verify client docker logs for default value', async () => { | ||
await (await cli.exec(`docker-compose -f cli/test-setup/docker-compose-scrape-intervals.yml up -d`)).assertSuccess(); | ||
await page.waitForTimeout(10_000); | ||
|
||
const scrapeSizeContainer = await cli.exec('docker logs pmm-client-scrape-intervals 2>&1 | grep \'promscrape.maxScrapeSize.*vm_agent\' | tail -1'); | ||
await scrapeSizeContainer.outContains(`promscrape.maxScrapeSize=\\\"${expectedScrapeSize}MiB\\\"`) | ||
const scrapeSizeLog = await cli.exec('docker logs pmm-client-scrape-interval 2>&1 | grep \'promscrape.maxScrapeSize.*vm_agent\' | tail -1'); | ||
await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=\\\"${defaultScrapeSize}MiB\\\"`) | ||
|
||
const scrapeSizeTarball = await cli.exec('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1') | ||
await scrapeSizeTarball.outContains(`promscrape.maxScrapeSize=${expectedScrapeSize}MiB`) | ||
}) | ||
await test.step('verify client docker logs for custom value', async () => { | ||
const scrapeSizeLog = await cli.exec('docker logs pmm-client-custom-scrape-interval 2>&1 | grep \'promscrape.maxScrapeSize.*vm_agent\' | tail -1'); | ||
await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=\\\"${customScrapeSize}MiB\\\"`) | ||
}) | ||
|
||
await test.step('verify logs from binary for default value', async () => { | ||
await (await cli.exec('sudo pmm-admin config --force \'--server-url=https://admin:[email protected]:1443\' --server-insecure-tls 127.0.0.1')).assertSuccess() | ||
|
||
const scrapeSizeLog = await cli.exec('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1') | ||
await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=${defaultScrapeSize}MiB`) | ||
}) | ||
|
||
await test.step('verify logs from binary for custom value', async () => { | ||
await (await cli.exec('sudo pmm-admin config --force \'--server-url=https://admin:[email protected]:2443\' --server-insecure-tls 127.0.0.1')).assertSuccess() | ||
|
||
const scrapeSizeLog = await cli.exec('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1') | ||
await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=${customScrapeSize}MiB`) | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ After(async ({ I }) => { | |
await I.verifyCommand('docker rm -f pg-local ubuntu'); | ||
}); | ||
|
||
|
||
Scenario( | ||
'PMM-T1201 Verify yum-cron updates are removed from PMM Server @settings', | ||
async ({ I }) => { | ||
|
@@ -38,55 +37,6 @@ Scenario( | |
); | ||
}, | ||
); | ||
Scenario( | ||
'@PMM-T1664 Verify vm_agents default value of -promscrape.maxScapeSize flag @cli', | ||
async ({ I }) => { | ||
const serverIp = await I.verifyCommand('curl ifconfig.me'); | ||
const containerName = 'pmm-server-default-scrape'; | ||
const expectedScrapeSize = '64'; | ||
|
||
await I.verifyCommand(`docker run -d -p 1443:443 -p 180:80 --name ${containerName} perconalab/pmm-server:dev-latest`); | ||
await I.asyncWaitFor(async () => await I.verifyCommand('echo $(curl -s -o /dev/null -w \'%{http_code}\' 0.0.0.0:180/ping)') === '200', 100); | ||
|
||
const containerIp = await I.verifyCommand(`docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${containerName}`); | ||
|
||
await I.verifyCommand(`docker run -d --name pmm-client-scrape --env PMM_AGENT_SETUP=1 --env PMM_AGENT_SERVER_ADDRESS=${containerIp}:443 --env PMM_AGENT_SERVER_USERNAME=admin --env PMM_AGENT_SERVER_PASSWORD=admin --env PMM_AGENT_PORTS_MIN=41000 --env PMM_AGENT_PORTS_MAX=41500 --env PMM_AGENT_SERVER_INSECURE_TLS=1 --env PMM_AGENT_CONFIG_FILE=config/pmm-agent.yaml --env PMM_AGENT_SETUP_NODE_NAME=pmm-client-scrape-container --env PMM_AGENT_SETUP_FORCE=1 --env PMM_AGENT_SETUP_NODE_TYPE=container perconalab/pmm-client:dev-latest`); | ||
await I.verifyCommand(`sudo pmm-admin config --force '--server-url=https://admin:[email protected]:1443' --server-insecure-tls ${serverIp}`); | ||
|
||
I.wait(5); | ||
|
||
const scrapeSizeTarball = await I.verifyCommand('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1 | grep -o \'promscrape.maxScrapeSize=.*MiB\''); | ||
const scrapeSizeContainer = await I.verifyCommand('docker logs pmm-client-scrape 2>&1 | grep \'promscrape.maxScrapeSize.*vm_agent\' | tail -1 | grep -o \'promscrape.maxScrapeSize=".*MiB"\''); | ||
|
||
I.assertEqual(scrapeSizeContainer, `promscrape.maxScrapeSize="${expectedScrapeSize}MiB"`, 'Max scrape size from client container logs does not match expected value!'); | ||
I.assertEqual(scrapeSizeTarball, `promscrape.maxScrapeSize=${expectedScrapeSize}MiB`, 'Max scrape size from local client logs does not match expected value!'); | ||
}, | ||
); | ||
|
||
Scenario( | ||
'@PMM-T1665 Verify that vm_agents -promscrape.maxScapeSize flag value can be set by user @cli', | ||
async ({ I }) => { | ||
const serverIp = await I.verifyCommand('curl ifconfig.me'); | ||
const containerName = 'pmm-server-custom-scrape'; | ||
const expectedScrapeSize = '128'; | ||
|
||
await I.verifyCommand(`docker run -d -p 2443:443 -p 280:80 --name ${containerName} --env PMM_PROMSCRAPE_MAX_SCRAPE_SIZE=${expectedScrapeSize}MiB perconalab/pmm-server:dev-latest`); | ||
await I.asyncWaitFor(async () => await I.verifyCommand('echo $(curl -s -o /dev/null -w \'%{http_code}\' 0.0.0.0:280/ping)') === '200', 100); | ||
|
||
const containerIp = await I.verifyCommand(`docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${containerName}`); | ||
|
||
await I.verifyCommand(`docker run -d --name pmm-client-scrape --env PMM_AGENT_SETUP=1 --env PMM_AGENT_SERVER_ADDRESS=${containerIp}:443 --env PMM_AGENT_SERVER_USERNAME=admin --env PMM_AGENT_SERVER_PASSWORD=admin --env PMM_AGENT_PORTS_MIN=41000 --env PMM_AGENT_PORTS_MAX=41500 --env PMM_AGENT_SERVER_INSECURE_TLS=1 --env PMM_AGENT_CONFIG_FILE=config/pmm-agent.yaml --env PMM_AGENT_SETUP_NODE_NAME=pmm-client-scrape-container --env PMM_AGENT_SETUP_FORCE=1 --env PMM_AGENT_SETUP_NODE_TYPE=container perconalab/pmm-client:dev-latest`); | ||
await I.verifyCommand(`sudo pmm-admin config --force '--server-url=https://admin:[email protected]:2443' --server-insecure-tls ${serverIp}`); | ||
|
||
const scrapeSizeTarball = await I.verifyCommand('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1 | grep -o \'promscrape.maxScrapeSize=.*MiB\''); | ||
const scrapeSizeContainer = await I.verifyCommand('docker logs pmm-client-scrape 2>&1 | grep \'promscrape.maxScrapeSize.*vm_agent\' | tail -1 | grep -o \'promscrape.maxScrapeSize=".*MiB"\''); | ||
|
||
I.wait(5); | ||
|
||
I.assertEqual(scrapeSizeContainer, `promscrape.maxScrapeSize="${expectedScrapeSize}MiB"`, 'Max scrape size from client container logs does not match expected value!'); | ||
I.assertEqual(scrapeSizeTarball, `promscrape.maxScrapeSize=${expectedScrapeSize}MiB`, 'Max scrape size from local client logs does not match expected value!'); | ||
}, | ||
); | ||
|
||
Scenario( | ||
'@PMM-T1696 Verify that PostgreSQL exporter collects uptime on Ubuntu @cli', | ||
|