Skip to content

Commit

Permalink
[load] run puppeteer script before gatling scenarios (#104836)
Browse files Browse the repository at this point in the history
* [load] puppeteer script before load testing

* install dependencies after metricbeat configuration

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
dmlemeshko and kibanamachine committed Jul 12, 2021
1 parent b8dfcaf commit 216bb5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/scripts/jenkins_build_load_testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ echo "cloud.auth: ${USER_FROM_VAULT}:${PASS_FROM_VAULT}" >> cfg/metricbeat/metri
cp cfg/metricbeat/metricbeat.yml $KIBANA_DIR/metricbeat-install/metricbeat.yml
# Disable system monitoring: enabled for now to have more data
#mv $KIBANA_DIR/metricbeat-install/modules.d/system.yml $KIBANA_DIR/metricbeat-install/modules.d/system.yml.disabled
echo " -> Building puppeteer project"
cd puppeteer
yarn install && yarn build
popd

# doesn't persist, also set in kibanaPipeline.groovy
Expand Down
10 changes: 10 additions & 0 deletions x-pack/test/load/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const simulationPackage = 'org.kibanaLoadTest.simulation';
const simulationFIleExtension = '.scala';
const gatlingProjectRootPath: string =
process.env.GATLING_PROJECT_PATH || resolve(REPO_ROOT, '../kibana-load-testing');
const puppeteerProjectRootPath: string = resolve(gatlingProjectRootPath, 'puppeteer');
const simulationEntry: string = process.env.GATLING_SIMULATIONS || 'branch.DemoJourney';

if (!Fs.existsSync(gatlingProjectRootPath)) {
Expand Down Expand Up @@ -52,6 +53,15 @@ export async function GatlingTestRunner({ getService }: FtrProviderContext) {
const log = getService('log');

await withProcRunner(log, async (procs) => {
await procs.run('node build/index.js', {
cmd: 'node',
args: ['build/index.js'],
cwd: puppeteerProjectRootPath,
env: {
...process.env,
},
wait: true,
});
for (let i = 0; i < simulationClasses.length; i++) {
await procs.run('gatling: test', {
cmd: 'mvn',
Expand Down

0 comments on commit 216bb5e

Please sign in to comment.