-
Notifications
You must be signed in to change notification settings - Fork 19
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
JDK Dependency #51
Comments
This came up as an issue because I user didn't have the JDK installed and tried to run |
There doesn't seem to be an easy way of detecting this when installing from npm. In theory, the CLI command could detect this, but also it is arguable that DigDug should be helping with this, and so have opened theintern/digdug#48 as well. |
Below is a node script that could be used to detect if java is installed or not. We could add something like that as a post install script in package.json or the cli command could use it as a check each time the command runs. @kitsonk thoughts? const { exec } = require('child_process');
let found = false;
function noJava() {
console.log('Java could not be detected.');
}
const javaVersion = exec('java -version', (err, stdout, stderr) => {
if (err) {
noJava();
} else {
let responseString = '';
stdout && (responseString += stdout.toString());
stderr && (responseString += stderr.toString());
const pos = responseString.indexOf('java version');
if (pos >= 0) {
const version = responseString.slice(pos).split('\n')[0].split(' ')[2];
console.log(`Detected Java version ${version}`);
found = true;
} else {
noJava();
}
}
});
javaVersion.on('close', () => {
process.exit(found ? 0 : 1);
}); |
That sounds like a good idea, of course modifying it to make sense in the usability of the command (which is essentially just warning people that they will not be able to run local tests without installing Java) I think @umaar ran into it too and got a bit frustrated and might have a comment about what would make good ergonomics on this. |
Problem: Running Can things be rearchitected in such a way where if someone only cares about testing in Chrome (which I think is a common use case), a fast-track path is taken to launching puppeteer or something - so that no Java is needed? For the warning: I like Ed's idea of running that script each time the user attempts to run functional tests and explaining why Java is needed, or linking to a webpage which explains it. I think it's important to run it as one of the first things so you don't have to wait for the app to be built, only to be told afterwards Java is required. Would also be good to get clarification on whether the JRE or JDK is needed. |
cli-test-intern
currently defaults to using selenium tunnel for functional tests, which requires the JDK. We either need to deal with this better or at least note it as part ofcli-test-intern
in some way.The text was updated successfully, but these errors were encountered: