Make tests work in docker
muan opened this issue · comments
This is what I've got so far: https://github.com/muan/emoji-cli/compare/tests, and here's what I want to do:
$ docker-compose run bintest
Dockerfile-test
installsxclip
, sets upXvfb
so I have a display forxclip
.- Test calls
emoji-cli poop
and script copies 💩 to the clipboard.<< Not working - Verify CLI output matches & clipboard content (
xclip -o
) matches
My futile attempts led me here opening an issue wishing I can source help from people who are more experienced in Docker than myself while documenting this of my own sanity. (my experience with docker dates back to the day I started this project. 😂)
I have tried many many things including CMD in docker compose file w/ bash -c
, shelling the Xvfb
command from the bintest
rake task, and using xvfb-run -a xclip
1 which led me me to more errors which I then failed to solve... 🙇
When running these in docker-compose run shell
the command just hangs and errors out with XSELINUXs still allocated at reset
:
$ Xvfb :1 &
$ ./mruby/build/x86_64-pc-linux-gnu/bin/emoji-cli poop
# while this totes works right after
$ echo 'hello' | xclip -i
$ xclip -o
hello
Ugh. I think I just need to stop now and reconvene in the future.
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":99"
after 10 requests (7 known processed) with 0 events remaining.