Skip to content

Commit

Permalink
PMM-7 default scrape size test
Browse files Browse the repository at this point in the history
  • Loading branch information
yurkovychv committed Aug 22, 2023
1 parent dac0a2d commit 35dbb76
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
28 changes: 0 additions & 28 deletions cli/tests/help.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]: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`)
})
});
})
29 changes: 29 additions & 0 deletions cli/tests/pmm-server-docker-generic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:[email protected]: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:[email protected]: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`)
})
});
})

0 comments on commit 35dbb76

Please sign in to comment.