While speaking to @nonsense last week about how to start this project, we mentioned that Testground would need a docker:js builder. However, I was thinking, and since Node.js doesn't produce binary files to run programs, we will also need a Docker and local runner for it that matches the same environment of the builder.
This is just blurring the lines between the builder and the runner for Node.js tests. If we think about it, what is building in Node.js besides npm install? So basically the runner should be the same image as the builder, right? Because some native dependencies may be coupled to the OS where they were built for.
Another thing is that copying node_modules over doesn't seem like the smartest idea. I have a suggestion: skip the build phase for Node.js. However, that would create a different problem: we would have to run n times npm install for each one of the docker images.
@nonsense after thinking for a bit, I think we could go with this for the Docker builder and runner:
The docker:js builder produces a docker image with everything self-contained (the project, node_modules, everything).
Well, as soon as I submitted this I just noticed that was the intended behaviour for docker:js builder and there is no point on leaving this issue open.
While speaking to @nonsense last week about how to start this project, we mentioned that Testground would need a
docker:js
builder. However, I was thinking, and since Node.js doesn't produce binary files to run programs, we will also need a Docker and local runner for it that matches the same environment of the builder.This is just blurring the lines between the builder and the runner for Node.js tests. If we think about it, what is building in Node.js besides
npm install
? So basically the runner should be the same image as the builder, right? Because some native dependencies may be coupled to the OS where they were built for.Another thing is that copying
node_modules
over doesn't seem like the smartest idea. I have a suggestion: skip the build phase for Node.js. However, that would create a different problem: we would have to runn
timesnpm install
for each one of the docker images.@nonsense after thinking for a bit, I think we could go with this for the Docker builder and runner:
docker:js
builder produces a docker image with everything self-contained (the project, node_modules, everything).local:docker
runs the produced image.