updates start-vault script to launch headless firefox for local testing (#29945)

This commit is contained in:
Jordan Reimer 2025-03-19 11:53:33 -06:00 committed by GitHub
parent 5905f43e1f
commit 173c3fe800
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 3 deletions

View File

@ -37,6 +37,7 @@
"test:quick": "node scripts/start-vault.js --split=8 --preserve-test-name --parallel",
"test:quick-oss": "node scripts/start-vault.js -f='!enterprise' --split=8 --preserve-test-name --parallel",
"test:filter": "node scripts/start-vault.js --server -f='!enterprise'",
"test:dev": "node scripts/start-vault.js",
"vault": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8200 vault server -log-level=error -dev -dev-root-token-id=root -dev-ha -dev-transactional",
"vault:cluster": "VAULT_REDIRECT_ADDR=http://127.0.0.1:8202 vault server -log-level=error -dev -dev-root-token-id=root -dev-listen-address=127.0.0.1:8202 -dev-ha -dev-transactional"
},

View File

@ -69,9 +69,15 @@ async function processLines(input, eachLine = () => {}) {
}
});
try {
// only the test:filter command specifies --server by default
const verb = process.argv[2] === '--server' ? 'test' : 'exam';
await testHelper.run('ember', [verb, ...process.argv.slice(2)]);
// ignore first 2 args (node and path) and extract flags to pass to test/exam command
const args = process.argv.slice(2);
const withServer = args.includes('--server') || args.includes('-s');
// current issue with headless Chrome where an event listener in Hds::Modal is not triggered resulting in a pending test waiter and timeout
// the workaround for now is to run the tests in headless firefox for local runs
if (!withServer && !process.env.CI) {
args.push('--launch=Firefox');
}
await testHelper.run('ember', ['exam', ...args]);
} catch (error) {
console.log(error);
process.exit(1);

View File

@ -25,6 +25,9 @@ module.exports = {
'--window-size=1440,900',
].filter(Boolean),
},
Firefox: {
ci: ['--headless'],
},
},
proxies: {
'/v1': {