Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create June 24, 2024 Release #1133

Merged
merged 9 commits into from
Jun 24, 2024
Next Next commit
Report errors in client getPage.js and server import script
  • Loading branch information
evmiguel committed May 20, 2024
commit 5fe46ecbc1103f15a3a3acc7bdf11813feafd2ce
14 changes: 14 additions & 0 deletions client/tests/util/getPage.js
Original file line number Diff line number Diff line change
@@ -38,6 +38,20 @@ const startServer = async serverOrClient => {
}
);

server.on('error', error => {
console.info(`Error found in startServer process: ${error}`); // eslint-disable-line no-console
});

server.on('exit', (code, signal) => {
if (code) {
console.error('startServer exited with code', code);
} else if (signal) {
console.error('startServer was killed with signal', signal);
} else {
console.info('startServer exited with no errors.'); // eslint-disable-line no-console
}
});

const killServer = async () => {
await new Promise((resolve, reject) => {
treeKill(server.pid, error => {
44 changes: 39 additions & 5 deletions server/scripts/import-tests/index.js
Original file line number Diff line number Diff line change
@@ -53,10 +53,18 @@ const builtTestsDirectory = path.resolve(gitCloneDirectory, 'build', 'tests');
const testsDirectory = path.resolve(gitCloneDirectory, 'tests');

const gitRun = (args, cwd = gitCloneDirectory) => {
return spawn
.sync('git', args.split(' '), { cwd })
.stdout.toString()
.trimEnd();
const gitRunOutput = spawn.sync('git', args.split(' '), { cwd });

if (gitRunOutput.error) {
console.info(
`'git ${args.split(' ')} ${cwd}' failed with error ${
gitRunOutput.error
}`
);
process.exit(1);
}

return gitRunOutput.stdout.toString().trimEnd();
};

const importTestPlanVersions = async transaction => {
@@ -66,12 +74,27 @@ const importTestPlanVersions = async transaction => {
const installOutput = spawn.sync('npm', ['install'], {
cwd: gitCloneDirectory
});

if (installOutput.error) {
console.info(
`'npm install ${gitCloneDirectory}' failed with error ${installOutput.error}`
);
process.exit(1);
}
console.log('`npm install` output', installOutput.stdout.toString());

console.log('Running `npm run build` ...\n');
const buildOutput = spawn.sync('npm', ['run', 'build'], {
cwd: gitCloneDirectory
});

if (buildOutput.error) {
console.info(
`'npm run build ${gitCloneDirectory}' failed with error ${buildOutput.error}`
);
process.exit(1);
}

console.log('`npm run build` output', buildOutput.stdout.toString());

importHarness();
@@ -233,7 +256,18 @@ const readRepo = async () => {
fse.ensureDirSync(gitCloneDirectory);

console.info('Cloning aria-at repo ...');
spawn.sync('git', ['clone', ariaAtRepo, gitCloneDirectory]);
const cloneOutput = spawn.sync('git', [
'clone',
ariaAtRepo,
gitCloneDirectory
]);

if (cloneOutput.error) {
console.info(
`git clone ${ariaAtRepo} ${gitCloneDirectory} failed with error ${cloneOutput.error}`
);
process.exit(1);
}
console.info('Cloning aria-at repo complete.');

gitRun(`checkout ${args.commit ?? ariaAtDefaultBranch}`);
Loading