From dac0a2db8d7504481249234448d6cb6eeea84147 Mon Sep 17 00:00:00 2001 From: yurkovychv Date: Tue, 22 Aug 2023 16:11:59 +0300 Subject: [PATCH] PMM-7 move tests --- cli/tests/help.spec.ts | 28 +++++++++++++++++++++ cli/tests/pmm-server-docker-generic.spec.ts | 28 --------------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cli/tests/help.spec.ts b/cli/tests/help.spec.ts index 52d67f8e5..c18db2acb 100644 --- a/cli/tests/help.spec.ts +++ b/cli/tests/help.spec.ts @@ -115,3 +115,31 @@ 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 7fbc6c03c..5de413e93 100644 --- a/cli/tests/pmm-server-docker-generic.spec.ts +++ b/cli/tests/pmm-server-docker-generic.spec.ts @@ -123,31 +123,3 @@ 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(); - }) - - 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`) - }) - }); -})