Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't pass a config object to the backstop command with Docker #987

Open
engelfrost opened this issue Feb 14, 2019 · 5 comments
Open

Can't pass a config object to the backstop command with Docker #987

engelfrost opened this issue Feb 14, 2019 · 5 comments

Comments

@engelfrost
Copy link
Contributor

engelfrost commented Feb 14, 2019

I have a Backstop project set up where the config is exported as a function which takes an options parameter (as described in the README).

const backstop = require('backstopjs');

(async () => {
  await backstop('test', {
    docker: true,
    config: require('./backstop.config.js')(),
  })
})();

I decided to start running tests with Docker, but when I did, running the tests failed.

Delegating command to Docker... docker run --rm -it --mount type=bind,source="/Users/josef/Code/backstopSanityTest",target=/src backstopjs/backstopjs:3.8.8 test "--moby=true" "--config=[object Object]" ""

--config=[object Object] is of course not a valid configuration.

Is this an issue with the code or with the documentation?

@garris
Copy link
Owner

garris commented Feb 15, 2019

Does this work if you were to run backstop locally -- without the docker flag?

I have a feeling that the docker implementation (in backstop) is not compatible with this approach. My guess is that this fixable if you have the time to look into it.

@engelfrost
Copy link
Contributor Author

Locally it works just fine, it's only when I add the Docker flag it fails. It's the combination of config object literal + Docker that causes the issue.

@garris
Copy link
Owner

garris commented Feb 15, 2019

Yup, thanks for confirming that. I guess to enable this the right way we would execute the config locally and pass a rendered config string/file to the docker instance? Might be a bit of work.

@engelfrost
Copy link
Contributor Author

Yes, would it be acceptable to generate a temporary config file and delete it once the test is complete?

@garris
Copy link
Owner

garris commented Feb 15, 2019

Sounds good to me. Maybe create a temp file with common prefix and unique suffix name in parallel with working config file. Something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants