Closed Nikschavan closed 2 years ago
@Nikschavan yep, that PR you referenced is required to be able to do this and it's definitely something we want to do.
I've also been considering switching to GitHub actions as a way to provide a test image that has local server pre downloaded.
Regarding your list I don't think Cavalcade should be disabled. Can you elaborate on why you did that? It uses the same container as the PHP one but with different settings so I'm not sure there's any time saving there really in terms of the download, maybe some in start up time.
I'd be reluctant to switch off anything more than the following by default:
Some of the others are dependent on the features you have configured eg. if you don't use S3 you don't need Tachyon, if you don't use search or native analytics you don't need elasticsearch.
I think we should look at adding support for CI environment config overrides specifically to help trim down what containers are spun up in CI.
Regarding your list I don't think Cavalcade should be disabled. Can you elaborate on why you did that? It uses the same container as the PHP one but with different settings so I'm not sure there's any time saving there really in terms of the download, maybe some in start-up time.
I actually did not check how much time an individual image is saving, I am still testing this and I will report back if I have more info on this.
I had disabled cavalcade as I believe it does not need to execute any jobs that get scheduled during the unit tests as they cannot be tested anyway (do correct me if I am wrong and if I am missing something here)
WordPress' test suite disables WP Cron as well, without a fallback cron method - https://github.com/WordPress/wordpress-develop/blob/master/tests/phpunit/includes/bootstrap.php#L85-L89
So my assumption was that disabling the cron will reduce the setup time as well as it "might" reduce the time/resources spent to execute the cron jobs. This is when I am assuming the cron jobs are indeed being executed when the tests are being run.
I am yet to run any tests on how much improvement disabling each image in the list mentioned above is adding, I will report back when I have some more stats on these.
I think this can be closed off as implemented in https://github.com/humanmade/altis-core/pull/487
When running the CI tests we need to set up local-server and that by-default pulls all the services even though they are not used in the CI environment and that adds up to the time required to run the tests in the CI.
For eg I believe - kibana, X-Ray, Cavalcade, mailhog can be disabled by default. Also based on project requirements things like Pinpoint, Cognito, tachyon can be disabled as well.
For now, we are disabling by forking the docker-compose.yml from the local-server in the project and copying this file in the CI environment just before starting the local-server.
But it would be nice to have a way to do this without needing to maintain a forked docker-compose file.
I see we are looking to generate the docker-compose.yml file in PHP (https://github.com/humanmade/altis-local-server/pull/159) hoping that will help with this?