Repository navigation
Avoid calling curl from tests #5174
Description
Activity
- addedtestIssues and PRs related to Node.js core tests and test infrastructure.Issues and PRs related to Node.js core tests and test infrastructure.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on 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:
- what is test/parallel/test-http-304.js even testing? It's not clear to me that it's got anything to do with 304 other than "I can set a 304 status code and not kill my http server".
- test/parallel/test-http-curl-chunk-problem.js is piping
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.
- removedgood first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.
on 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.- addedhttpIssues and PRs related to the http subsystem.Issues and PRs related to the http subsystem.
on Feb 10, 2016 cc @nodejs/testing
I'd be up for trying to get this done if we want to do it
- added a commit that references this issue
on Mar 30, 2016 - added a commit that references this issue
on Mar 30, 2016 - added a commit that references this issue
on Mar 30, 2016 - added a commit that references this issue
on Mar 31, 2016 - added a commit that references this issue
on Jul 27, 2026
Adding so I don't forget -- we currently invoke curl in two tests which implicitly pulls it as a dependency:
Suggesting we replace this with.. javascript?