Avoid calling curl from tests #5174
Copy link
Copy link
Closed
Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
Description
Adding so I don't forget -- we currently invoke curl in two tests which implicitly pulls it as a dependency:
$ ag "curl " test
test/parallel/test-http-304.js
13: childProcess.exec('curl -i http://127.0.0.1:' + common.PORT + '/',
test/parallel/test-http-curl-chunk-problem.js
19: console.log('making curl request');
20: var cmd = 'curl http://127.0.0.1:' + common.PORT + '/ | ' +Suggesting we replace this with.. javascript?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
httpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.testIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.
Activity
rvagg commentedon Feb 10, 2016
curlisn't the only unix util in the tests, there'ssed,tail,grep,catand probably more, which is why we have "git bash" as one of the recommended prerequisites for setting up a dev environment.curldoes have the nice side effect of validating Node's HTTP server implementation. Having said that, I don't think I'd object to someone writing a replacement in common.js for it.On the two tests in question:
curloutput toopenssl-cliat the heart of the test and there's a link pointing to https://groups.google.com/forum/#!topic/nodejs/9mzTyWBAaRk which implicatescurlas a problematic client for node (hence the name of the test I think). So maybe it's not such a good target for rewriting although it could have a bail-if-no-curlclause like we do withcommon.opensslCli.jbergstroem commentedon Feb 10, 2016
curllives outside of coreutils or what for instancebusyboxwould offer (it has the other examples you brought up) hence my suggestion. I didn't really look into this other than running into the 'missing dependency' issue; the plan was to have a look at it a bit later.Looking into
test-http-304; pretty pointless; not even checking status code or an empty body.test-http-curl-chunk-problem.js; author suggests that more clients has the same issue, but its pretty obvious that curl is what we're after.I'm not particularly keen on growing the common.js-convention of
hasThis/isThat, but I'd take a skip over fail any day.orangemocha commentedon Feb 11, 2016
cc @nodejs/testing
MylesBorins commentedon Feb 11, 2016
I'd be up for trying to get this done if we want to do it
test: remove the use of curl in the test suite
test: remove the use of curl in the test suite
test: remove the use of curl in the test suite
test: remove the use of curl in the test suite
test: remove the use of curl in the test suite