Open dakkusingh opened 6 years ago
As we use a separate mariadb container, a fresh test won't have a database installed. In other words, if we put settings.php in the proper place, it won't be functional because the database still has to be imported. My thinking was that by keeping it out it was more obvious that you have to do something (a drush site-install or database import) if you want a test site.
What do you think? Is there a better way to make that clear?
@deviantintegral Thank you for taking the time & replying through some of my questions, much appreciate you sharing the thought process behind some of the decisions.
I think what we are saying here is 2 things really: 1) database setup and settings.php etc should be neatly self contained. therefore, if you need a DB, you have to instigate a "build" step. 2) I think its worth breaking out the test steps and build steps into their own, where test is dependent on build.
I think it might be worth doing this in Robo..
protected function buildEnvironment()
{
$force = true;
$tasks = [];
$tasks[] = $this->taskFilesystemStack()
->copy('.travis/docker-compose.yml', 'docker-compose.yml', $force)
->copy('.travis/traefik.yml', 'traefik.yml', $force)
->copy('.travis/.env', '.env', $force)
->copy('.travis/config/settings.local.php',
'web/sites/default/settings.local.php', $force)
->copy('.travis/config/behat.yml', 'tests/behat.yml', $force);
$tasks[] = $this->taskExec('docker-compose pull --parallel');
$tasks[] = $this->taskExec('docker-compose up -d');
return $tasks;
}
In general, I am quite partial to wrapping up all my tasks in Robo rather than bash.
Here is what I am currently doing for coding standards..
happy to work with you in roboising the scripts if thats a direction you see pursuing.
In Dockerfile: https://github.com/deviantintegral/drupal_tests/blob/master/Dockerfile#L62 We move the settings to outside the HTML folder, is this intentional?
I found some code in test-js.sh https://github.com/deviantintegral/drupal_tests/blob/master/hooks/test-js.sh#L30
its doing:
I havent looked too deeply but why not move the settings.php to the correct place to begin with:
and remove this step in test-js.sh https://github.com/deviantintegral/drupal_tests/blob/master/hooks/test-js.sh#L30