Running Docker image backstopjs results in Error Error: Cannot find module '/src/backstop.json'
See original GitHub issueHi together, first of all thanks for BackstopJS. This really is a time saver.
I’ve some trouble running the backstopjs/backstopjs:v3.1.21
image in a Gitlab CI pipeline. Locally it’s not a problem, only on Gitlab it seems to be a problem. I just want to post this issue here for others and I’ve no solution for now - hoping to get more infos with this issue.
I run the following on a Gitlab runner via .gitlab-ci.yml
(this is only the first iteration to see how it could work - I don’t want to setup a full-fledged infrastructure for the webserver):
This only for verbose output to see if the volumes are mounted:
docker run --rm --entrypoint "/bin/ls" -v ${PWD}/backstop.json:/src/backstop.json -v ${PWD}/backstop_data/:/src/backstop_data/ backstopjs/backstopjs:v3.1.21 -l
total 8
drwxr-xr-x 2 root root 4096 Apr 13 11:30 backstop.json
drwxr-xr-x 2 root root 4096 Apr 13 11:30 backstop_data
And this to run the official backstopjs/backstopjs
image:
$ docker run --rm -v ${PWD}/backstop.json:/src/backstop.json -v ${PWD}/backstop_data/:/src/backstop_data/ backstopjs/backstopjs:v3.1.21 test
BackstopJS v3.1.21
Error Error: Cannot find module '/src/backstop.json'
Does anyone had a similar issue? Thank you in advance.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to fix docker container running 'cannot find module' error?
Your Dockerfile seems ok and your project structure, too. I assume that the docker image is faulty for some reason and missing the...
Read more >backstopjs - npm
Start using backstopjs in your project by running `npm i backstopjs`. ... Pass a --docker flag to render your test in a Docker...
Read more >BackstopJS Docker Image
A self-contained Docker image to run BackstopJS with no external dependencies. Visual Regression Testing with BackstopJS in a Docker container. Features:.
Read more >Thanks for this.. I'm having a bit of trouble testing my… |
Visual Regression Testing with BackstopJS in a Docker container ... backstop_1 | Loading config: /src/backstop.json backstop_1 |
Read more >Visual Regression Testing with BackstopJS in a Docker ...
In case you did not hear about BackstopJs — it is a visual regression testing (VRT) tool for web applications. It supports screen...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The problem was, that I ran the command
within the
script:
section of the.gitlab-ci.yml
.This doesn’t work in Gitlab CI. Instead I switched to use
backstopjs/backstopjs
as the base image for my stage and overwrite the entrypoint to start backstop inscript:
:So this was not an issue with your docker image, rather than how I configured my
.gitlab-ci.yml
.Having the same issue in circle ci config. Any idea on how to fix it?