Merge pull request #5078 from Tyriar/shell_tests

Get tests working on node that requires shell arg
This commit is contained in:
Daniel Imms
2024-07-02 13:01:52 -07:00
committed by GitHub
7 changed files with 25 additions and 14 deletions
@@ -5,14 +5,14 @@ const config: PlaywrightTestConfig = {
timeout: 10000,
projects: [
{
name: 'Chrome Stable',
name: 'ChromeStable',
use: {
browserName: 'chromium',
channel: 'chrome'
}
},
{
name: 'Firefox Stable',
name: 'FirefoxStable',
use: {
browserName: 'firefox'
}
+2 -2
View File
@@ -5,14 +5,14 @@ const config: PlaywrightTestConfig = {
timeout: 10000,
projects: [
{
name: 'Chrome Stable',
name: 'ChromeStable',
use: {
browserName: 'chromium',
channel: 'chrome'
}
},
{
name: 'Firefox Stable',
name: 'FirefoxStable',
use: {
browserName: 'firefox'
}
+7 -3
View File
@@ -6,7 +6,7 @@
const cp = require('child_process');
const path = require('path');
const COVERAGE_LINES_THRESHOLD = 60;
const COVERAGE_LINES_THRESHOLD = 40;
// Add `out` to the NODE_PATH so absolute paths can be resolved.
const env = { ...process.env };
@@ -31,7 +31,6 @@ if (process.argv.length > 2) {
}
const checkCoverage = flagArgs.indexOf('--coverage') >= 0;
if (checkCoverage) {
flagArgs.splice(flagArgs.indexOf('--coverage'), 1);
const executable = npmBinScript('nyc');
@@ -44,6 +43,7 @@ if (checkCoverage) {
{
cwd: path.resolve(__dirname, '..'),
env,
shell: true,
stdio: 'inherit'
}
);
@@ -56,6 +56,7 @@ const run = cp.spawnSync(
{
cwd: path.resolve(__dirname, '..'),
env,
shell: true,
stdio: 'inherit'
}
);
@@ -64,4 +65,7 @@ function npmBinScript(script) {
return path.resolve(__dirname, `../node_modules/.bin/` + (process.platform === 'win32' ? `${script}.cmd` : script));
}
process.exit(run.status);
if (run.error) {
console.error(run.error);
}
process.exit(run.status ?? -1);
+5 -1
View File
@@ -50,6 +50,7 @@ server.stdout.on('data', (data) => {
[...testFiles, ...flagArgs], {
cwd: path.resolve(__dirname, '..'),
env,
shell: true,
stdio: 'inherit'
}
);
@@ -61,7 +62,10 @@ server.stdout.on('data', (data) => {
server.kill();
process.exit(run.status);
if (run.error) {
console.error(run.error);
}
process.exit(run.status ?? -1);
}
});
+5 -2
View File
@@ -40,12 +40,15 @@ async function run() {
console.log(`\n\x1b[32m${command}\x1b[0m`, args);
const run = cp.spawnSync(command, args, {
cwd: path.resolve(__dirname, '..'),
shell: true,
stdio: 'inherit'
}
);
if (run.status) {
process.exit(run.status);
if (run.error) {
console.error(run.error);
}
process.exit(run.status ?? -1);
}
}
run();
+2 -2
View File
@@ -39,8 +39,8 @@
"test-api-firefox": "node ./bin/test_api.js --browser=firefox --timeout=20000",
"test-api-webkit": "node ./bin/test_api.js --browser=webkit --timeout=20000",
"test-playwright": "node ./bin/test_playwright.js --workers=75%",
"test-playwright-chromium": "node ./bin/test_playwright.js --workers=75% \"--project=Chrome Stable\"",
"test-playwright-firefox": "node ./bin/test_playwright.js --workers=75% \"--project=Firefox Stable\"",
"test-playwright-chromium": "node ./bin/test_playwright.js --workers=75% \"--project=ChromeStable\"",
"test-playwright-firefox": "node ./bin/test_playwright.js --workers=75% \"--project=FirefoxStable\"",
"test-playwright-webkit": "node ./bin/test_playwright.js --workers=75% \"--project=WebKit\"",
"test-playwright-debug": "node ./bin/test_playwright.js --workers=1 --headed --timeout=30000",
"test-unit": "node ./bin/test.js",
+2 -2
View File
@@ -5,14 +5,14 @@ const config: PlaywrightTestConfig = {
timeout: 10000,
projects: [
{
name: 'Chrome Stable',
name: 'ChromeStable',
use: {
browserName: 'chromium',
channel: 'chrome'
}
},
{
name: 'Firefox Stable',
name: 'FirefoxStable',
use: {
browserName: 'firefox'
}