npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Issue with-- Jest preset plugin

I used Jest preset plugin to run jest -puppeteer tests in a docker container. Worked fine locally. However when running through remote jenkins, it fails to start docker container?

Jenkins cannot start docker container

Followed the instructions on the page …tests run fine in docker only locally Below is the error…

14:48:20 Successfully built 05a128b6706e 14:48:20 Successfully tagged docker_chromium:latest 14:48:20 14:48:20 Building chromium 14:48:20 14:48:20 Docker Chromium: Successfully built Docker image 14:48:20 Docker Chromium: Starting Docker container… 14:48:20 Error: Docker Chromium: Failed to start Docker container 14:48:20 14:48:20 Internal Error: 14:48:20 14:48:20 Error: Command failed: docker-compose -f “/data/jenkins/workspace/MadService_automation_test_run/node_modules/docker-chromium/docker/docker-compose.yml” up -d chromium 14:48:20 Creating docker_chromium_1 … 14:48:20 Creating docker_chromium_1 14:48:20 e[1Ae[2K Creating docker_chromium_1 … e[31merrore[0m e[1B 14:48:20 ERROR: for docker_chromium_1 Cannot create container for service chromium: invalid port specification: “None” 14:48:20 14:48:20 ERROR: for chromium Cannot create container for service chromium: invalid port specification: “None” 14:48:20 Encountered errors while bringing up the project. 14:48:20 14:48:20 at dockerUp (/data/jenkins/workspace/MadService_automation_test_run/node_modules/docker-chromium/lib/index.js:82:15) 14:48:20 at <anonymous> 14:48:20 npm ERR! code ELIFECYCLE 14:48:20 npm ERR! errno 1 14:48:20 npm ERR! mad-service@1.0.0 test-automation: jest --verbose --config=automation/config/jest.config.js 14:48:20 npm ERR! Exit status 1 14:48:20 npm ERR!
Hi! Thanks for taking the time to file a bug report!


Platform Info

$ npm --versions


$ node -p process.platform

Cannot understand this error

I think the error is coming from this command, but I am not sure why:

docker-compose -f "/data/jenkins/workspace/MadService_automation_test_run/node_modules/docker-chromium/docker/docker-compose.ym"” up -d chromium

This older issue describes interaction between docker-compose and python versions with similar error:

out of the 2 solution,

It looks like a problem with docker-compose on a Jenkins server, so help in this npm forum will be limited! I don’t know if downgrading docker-compose will help.

I can explain how I think the port number error occurs. jest-puppeteer-docker depends on docker-chromium, which has a docker-compose.yml with port number specified like:

      - '9222:9222'

For some reason this format is not recognised by the docker-compose on your Jenkins server.

Is there another way ports: can be specified?