Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions scripts/circleci/run_devtools_e2e_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {spawn} = require('child_process');
const {join} = require('path');

const ROOT_PATH = join(__dirname, '..', '..');

const reactVersion = process.argv[2];
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');

Expand Down Expand Up @@ -74,7 +74,15 @@ function runTestShell() {

logBright('Starting testing shell server');

serverProcess = spawn('yarn', ['start'], {cwd: shellPackagePath});
if (!reactVersion) {
serverProcess = spawn('yarn', ['start'], {cwd: shellPackagePath});
} else {
serverProcess = spawn('yarn', ['start'], {
cwd: shellPackagePath,
env: {...process.env, REACT_VERSION: reactVersion},
});
}

serverProcess.stdout.on('data', data => {
if (`${data}`.includes('Compiled successfully.')) {
logBright('Testing shell server running');
Expand Down Expand Up @@ -106,8 +114,15 @@ function runTestShell() {

async function runEndToEndTests() {
logBright('Running e2e tests');
if (!reactVersion) {
testProcess = spawn('yarn', ['test:e2e'], {cwd: inlinePackagePath});
} else {
testProcess = spawn('yarn', ['test:e2e'], {
cwd: inlinePackagePath,
env: {...process.env, REACT_VERSION: reactVersion},
});
}

testProcess = spawn('yarn', ['test:e2e'], {cwd: inlinePackagePath});
testProcess.stdout.on('data', data => {
// Log without formatting because Playwright applies its own formatting.
const formatted = format(data);
Expand Down