Sample Circle CI integration with Drupal 8.
10K+
This is a demo repository for running PHPUnit and Behat tests in Drupal 8 projects. It contains:
If you want to test and individul module and not a whole Drupal site, see drupal_tests.
Demo https://www.youtube.com/watch?v=Uc3vI8ztsqU
Run composer install from the repository root.
Copy core/phpunit.xml.dist to core/phpunit.xml.
Set the SIMPLETESTDB environment variable:

Run unit and kernel tests in the modules/custom directory:
cd web
../vendor/bin/phpunit -c core --verbose --debug modules/custom

Demo https://www.youtube.com/watch?v=XoxRv8x5ZIs
Full docs at https://behat-drupal-extension.readthedocs.io/en/3.1/localinstall.html
Install Drupal as usual. Follow instructions at https://www.drupal.org/docs/8/install.
Open http://www.seleniumhq.org/download and download it to a sub-directory of your home directory.
$PATH variable. For example, in Ubuntu you could
run sudo mv /tmp/chromedriver /usr/local/bin.[juampy@carboncete ~/Software]$ java -jar selenium-server-standalone-3.6.0.jar
cd /path/to/composer.json
composer require --dev drupal/drupal-extension:master-dev
Open tests/behat.yml and check that base_url and drupal_root are correct.
[juampy@carboncete /var/www/drupal/d8cidemo/web (master)]$ ../vendor/bin/behat --verbose -c ../tests/behat.yml
Sample job run: https://circleci.com/gh/juampynr/d8cidemo/19
The brains of the CircleCI integration are at the CircleCI configuration file, which orchestrates what should happen when something is pushed to the repository.
.circleci/config.yml uses a container for MariaDB, another one for PhantomJS (used for
Behat tests) and a custom image for setting up the Drupal environment.
Install the CircleCI command line interface at https://circleci.com/docs/2.0/local-jobs/. Then
clone this repository and run the job with circleci build.
Sign up with GitHub at https://circleci.com/signup/ and then allow access to your fork of this repository. Then either trigger a build manually, push a change or create a pull request to trigger the build job. Then see the results at https://circleci.com/dashboard.
Content type
Image
Digest
Size
230.8 MB
Last updated
almost 9 years ago
docker pull juampynr/d8cidemo