Is it acceptable to create tests relying on docker for a node.js module?

I currently have a module which needs to be tested in different scenarios.

But to improve the tests I have a lot of file copying and child-process execs to do.

  • Customisation of the official Selenium Hub docker image returns 'Permission denied'
  • Host name does not match the certificate subject provided by the peer, but it's a perfect match
  • How do I run a docker instance from a DockerFile?
  • Docker commit doesn't save the changed state of my container
  • Cannot connect to wss://ip:5063 when deploy restcomm docker to public server
  • Can't connect to docker process
  • Maybe Docker would be a good solution to run the tests, but this would add a dependency on Docker.

    Also I haven’t seen packages relying on docker for such scenarios so far.

    So for an npm package, would it be acceptable to publish a package with tests relying on docker?

  • How to set the container name used for --link option with Docker
  • containers and host user space shared when created using virsh
  • Tunnel Connection Failed error when logging into artifactory docker registry
  • Why can't I ping docker container?
  • Unable to run mariadb when mount volume
  • Recover Percona Xtradb in container
  • One Solution collect form web for “Is it acceptable to create tests relying on docker for a node.js module?”

    I’d first think about your intended audience – how likely is it that users downloading your module will already have Docker installed?

    If your module is already Docker related, it’s fare to assume most users will already have Docker. If it’s a util for handling React routes, probably not.

    You should also consider the impact of not testing certain difficult to test features vs the difficulty or complexity created by testing them.

    For the vast majority of people using npm modules, they rarely run the tests anyway. Running tests is reserved for people who actively want to develop and contribute to modules.

    One common approach which might fit your problem is to include the Docker setup and tests in the project but exclude them from the actual module itself. In your package.json for the module, you can include a files property which defines which files should actually be included when publishing the module.

    With this approach you can setup and run tests in a way that suits you – and is available for any helpful contributors if they want it – but doesn’t burden day-to-day users with extra setup they don’t need.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.