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.

  • How microservices communicate each other when implemented using Docker?
  • How to forward upstream from nginx to upstream server
  • Running a single Docker Cloud's HAProxy container with SSL and non-SSL simultaneously
  • Can't use yum inside Docker container running on CentOS
  • Why do I have to use volumes instruction in docker-compose
  • Docker Container Failed to Run
  • 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?

  • Docker and CPU Priority when applying CPU Hogs
  • Jenkins setting up
  • Docker build unable to install pg gem in Sinatra project
  • Running nginx-proxy in docker with ssl
  • How to check if the restart policy works of Docker
  • Gitlab, docker and sendmail ports
  • 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.