kibana/x-pack/solutions/observability/plugins/apm/scripts/test/e2e.js
Sergi Romeu ba92d08a58
[APM] Migrate APM Cypress tests to on_merge from on_merge_unsupported_ftrs (#203991)
## Summary

Closes https://github.com/elastic/kibana/issues/203837
[Internal] Closes
https://github.com/elastic/observability-dev/issues/4126?reload=1?reload=1

This PR moves APM Cypress tests to be run on the main pipeline instead
of the unsupported one.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-01-16 12:57:50 +01:00

40 lines
1.1 KiB
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
/* eslint-disable no-console */
const path = require('path');
const yargs = require('yargs');
const childProcess = require('child_process');
const { argv } = yargs(process.argv.slice(2))
.parserConfiguration({ 'unknown-options-as-args': true })
.option('headed', {
default: false,
type: 'boolean',
description: 'Runs Cypress in headed mode',
})
.help();
const e2eDir = path.join(__dirname, '../../ftr_e2e');
function runTests() {
const mode = argv.headed ? 'open' : 'run';
console.log(`Running e2e tests: "yarn cypress:${mode}"`);
return childProcess.spawnSync('yarn', [`cypress:${mode}`], {
cwd: e2eDir,
encoding: 'utf8',
stdio: 'inherit',
});
}
let exitStatus = 0;
const child = runTests();
exitStatus = child.status;
process.exitCode = exitStatus;
console.log(`Quitting with exit code ${exitStatus}`);