Open singles opened 6 years ago
I’ve stumbled upon the same problem. Additionally when creating the report fails the process exits with 0
, which made our CI pipeline silently pass, even though the tests were actually failing.
This might be an issue of fs-extra
which preservers the permissions of copied files.
I am also just running into this problem when packaging in using Electron. The files get packaged in \release\build\win-ia32-unpacked\resources\app.asar\node_modules\backstopjs\compare\output
which is a read-only archive.
I am using the code from #1400 for my Electron project and I am passing the comparePath in my config like so:
"comparePath": ${backstopDataDir}/compare/output
,
It seems to be working at the moment.
Description of a problem
In environments where
node_modules
are read-only browser report isn't created.Examples of such environments: nix based builds, where
node_modules
land in/nix/store
as read-only (555
or444
rights). Another one might be some stateless build systems, wherenode_modules
is passed between build steps as an artifact and also might be read-only.How to reproduce:
Potential cause
I dug a little into the internals and it looks that it's caused by https://github.com/garris/BackstopJS/blob/ddfedcbd2d63fd6108922bf0bfabc31d672fd5c1/core/command/report.js#L26
where
fs.copy
copiesoutput
with directory rights. Assuming I'm not wrong about how *nix systems handle permissions, in presented case, there's nowrite
foroutput
directory - thus no new directorieshtml_report
directory on the project side can be created as part ofcopy
.Workarounds
One workaround is to create directory structure before running tests, something like:
Summary
Not sure whether it should be considered as a bug, I just wanted to point out that current implementation might be causing some issues.