Add test case for `yarn start `
At times it happens some code gets checked in and build processes or bootstrap processes fail. One of the most frustrating ones could be yarn start. If a new developer isn't able to do a clean yarn start, then he/she could lose interest and focus quickly. Long time back netmonitor used to run with yarn start now I've got to painfully wait for mozilla-central builds.
Recently there was some issue with yarn start, a patch was suggested by @fvsch and it worked.
Something like comment out require("postcss-bidirection") in postcss.config.js
I was lucky to find fvsch's reply quickly. Instead can we have a test case that runs and then waits for say 10s and figures out that the process of yarn start is still running or hasn't ended with non 0 status code.
I'm not sure if its correct to file this bug, but would greatly appreciate if something like this is in place.
Thoughts @fvsch @jasonLaster ?
Thanks @ruturajv, i agree that this would be nice. I think we could write a small node script that executes yarn start and checks to see if it started correctly. Perhaps if you can curl http://localhost:8000/assets/build/debugger.js...
Great, I'll try if I can create something on those lines..
I have a very rudimentary script doing stuff (just console.logging instead of asserting). However it has 1 problem, the yarn start process invokes another node bin/dev-server process. This child process doesn't get killed. There are some ways of fixing that but they might be very OS specific or I'ven't read the docs properly :)
Here is the script anyways. Your views @jasonLaster ?
const { spawn } = require('child_process');
const http = require('http');
let yarnProc;
function yarnStart(){
yarnProc = spawn('yarn', ['start']);
yarnProc.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
if(data.indexOf("8000") > 0){
callDebuggerJs();
}
});
yarnProc.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
}
function callDebuggerJs() {
let req = http.get('http://localhost:8000/assets/build/debugger.js', (resp) => {
let data = '';
// A chunk of data has been recieved.
resp.on('data', (chunk) => {
data += chunk;
});
// The whole response has been received. Print out the result.
resp.on('end', () => {
console.log(`${data.length} bytes downloaded`);
// assert status code is 200
console.log(resp.statusCode);
// kill the process
console.log(yarnProc.kill());
process.exit();
});
}).on("error", (err) => {
console.log("Error: " + err.message);
});
// req.end(e => console.log(e));
}
yarnStart();
/claim
Thanks for claiming the issue! :wave:
!!! Please check your email and confirm the invitation
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
/unclaim
Support for the Launchpad has been deprecated, closing.
Also, Firefox Developer Tools (including Debugger tool) development is entirely happening in Bugzilla and new issues should be reported here: https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Debugger
Honza