-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Docker compose for testing #9525
Conversation
I don't like docker and I have no clue about docker, but...
|
Do I understand correctly that you would merge this if the image is built in https://github.com/roundcube/roundcubemail-docker and we drop the
How would you currently make the CI to use an external IMAP server? |
Let's use docker in CI. I want possibility to run tests (manually) against an external IMAP server (and local greenmail). As for docker. I don't care what the image we use or build it is coming from. I don't want docker related stuff outside of .ci directory. |
So we don't have to specify them on the command line when we check codestyle locally.
It uses standalone containers for the greenmail IMAP server and the standalone browser. A testrunner image is built in the CI (for `linux/amd64` only, because Github doesn't support multi-platform building on their default runners and we don't have our own.) This setup helps to run the tests (reproduceably) also locally. Previously, on my machine, they produced varying results. It also reduces the dependencies for running the browser test. Local execution only depends on `docker compose`, no other tools (previously it required `sudo`, `java`, and some more.) The previous solution should still work, if you want it. The scripts are stored in a directory called `.ci` to hide them a little and avoid confusion with the container images from the `roundcubemail-docker` repo.
This only was a flaky problem only occurring sometimes.
In other code the initial connection is forced. Doing this here, too, fixes occasional problems with lost imap connections.
f36146d
to
49a6811
Compare
This setup works in the CI and in a container, and still allows to run the script locally as well as using an external IMAP-Server. Please review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Looks good, almost there. |
Looks good, but can we move compose.yaml from root? |
This way it's less easy mistaken as usable for running Roundcubemail in production.
I moved it into |
|
Why that? It's not used in the CI at all. |
Everything else is in .ci including docker images and run scripts. |
I don't really agree, but don't find it very important either and want this merged, so here you go. Can you merge it now? |
I couldn't get the browser tests to run green locally, and felt uneasy about running a downloaded binary with superuser-rights (the IMAP-server) on my machine anyway. So I decided to build a testing setup with docker compose, which depends on external containers for the browser and the IMAP-server and helps to make the environment reproducecable. Additionally it is faster for repeated runs, because it doesn't repeatedly downloads the server-jar, installs the webdriver, etc.
And because more people might find it useful I'm posting this pull request.
We could also rebuild the automated testing workflows to use services (external containers) to speed things up. But before I do that I wanted to know if this gets merged or provokes discussion in the first place.
The container image needs to be built locally, currently. If this gets merged I'd set it up to be built repeatedly on github and to be downloadable.