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.

  • Monitoring node processes within docker containers
  • Can't see staring installation page of wordpress docker container based on alpine linux
  • How can I open up webcam and process images with docker and OpenCV?
  • How to install a non-distro package inside Docker without wasting space?
  • Execution is overlapped nodes created by docker selenium grid and distribution with testNG data provider how avoid this?
  • How to see a linked container as localhost?
  • 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?

  • Where are the downloaded docker images on my mac? Any fixed directory?
  • Explanation about Supervisor and tail over Apache's error.log
  • Most appropriate container for a data only container?
  • ASP.NET exceptions in AWS Linux
  • Docker - Elasticsearch - Failed to establish a new connection: [Errno 111] Connection refused',))
  • Connect to Mysql on localhost from docker 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.