diff --git a/cli/tests/help.spec.ts b/cli/tests/help.spec.ts index c18db2acb..52d67f8e5 100644 --- a/cli/tests/help.spec.ts +++ b/cli/tests/help.spec.ts @@ -115,31 +115,3 @@ test.describe('PMM Client "--help" validation', async () => { ]); }); }); - -test.describe('-promscrape.maxScapeSize tests', async () => { - test.beforeAll(async () => { - await (await cli.exec(`docker-compose -f test-setup/docker-compose-scrape-intervals.yml up -d`)).assertSuccess(); - }) - - test.afterAll(async () => { - await (await cli.exec(`docker-compose -f test-setup/docker-compose-scrape-intervals.yml down`)).assertSuccess(); - }) - - test('@PMM-T1665 Verify custom value for vm_agents -promscrape.maxScapeSize parameter', async ({page}) => { - const customScrapeSize = '128'; - - await test.step('verify client docker logs for custom value', async () => { - await page.waitForTimeout(10_000); - 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 custom value', async () => { - await (await cli.exec('sudo pmm-admin config --force \'--server-url=https://admin:admin@0.0.0.0:2443\' --server-insecure-tls 127.0.0.1')).assertSuccess() - - await page.waitForTimeout(10_000); - const scrapeSizeLog = await cli.exec('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1') - await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=${customScrapeSize}MiB`) - }) - }); -}) diff --git a/cli/tests/pmm-server-docker-generic.spec.ts b/cli/tests/pmm-server-docker-generic.spec.ts index 5de413e93..ba249b05a 100644 --- a/cli/tests/pmm-server-docker-generic.spec.ts +++ b/cli/tests/pmm-server-docker-generic.spec.ts @@ -123,3 +123,32 @@ test.describe('PMM Server CLI tests for Docker Environment Variables', async () expect(output.getStdOutLines()[3], `Verify Clickhouse metadata_path contains "${expectedPath}"`).toContain(expectedPath); }); }); + +test.describe('-promscrape.maxScapeSize tests', async () => { + test.beforeAll(async () => { + await (await cli.exec(`docker-compose -f test-setup/docker-compose-scrape-intervals.yml up -d`)).assertSuccess(); + }) + + test.afterAll(async () => { + await (await cli.exec(`docker-compose -f test-setup/docker-compose-scrape-intervals.yml down`)).assertSuccess(); + await (await cli.exec(`sudo pmm-admin config --force \'--server-url=https://admin:admin@0.0.0.0:443\' --server-insecure-tls 127.0.0.1 || true`)).assertSuccess(); + }) + + test('@PMM-T1665 Verify custom value for vm_agents -promscrape.maxScapeSize parameter', async ({page}) => { + const customScrapeSize = '128'; + + await test.step('verify client docker logs for custom value', async () => { + await page.waitForTimeout(10_000); + 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 custom value', async () => { + await (await cli.exec('sudo pmm-admin config --force \'--server-url=https://admin:admin@0.0.0.0:2443\' --server-insecure-tls 127.0.0.1')).assertSuccess() + + await page.waitForTimeout(10_000); + const scrapeSizeLog = await cli.exec('ps aux | grep -v \'grep\' | grep \'vm_agent\' | tail -1') + await scrapeSizeLog.outContains(`promscrape.maxScrapeSize=${customScrapeSize}MiB`) + }) + }); +})