2

In order to run DrupalWebTests on travis-ci, I need to build a new Drupal instance where these tests are ran.

Typically, one runs these tests with drush -l http://localhost.example test-run SomeTest

This, however, assumes Drupal installed, being served on http://localhost.example (a webserver) and it being connected to a database as set in settings.php, having simpletest enabled.

Typically, this means installing MySQL, Apache and installing and configuring Drupal. Those are heavy depedencies and doing so for each test-case or even just every build, will require a lot of overhead; a build server like Travis will need to install these servers for each test-run.

Drush has drush run-server to run a lightweight server. Drupal can run off a sqlite database, which would be extremely usefull for these tests.

Moreover: as far as I can make out, the actual web-tests are not ran from that Drupal-instance at http://localhost.example, but get a clean build and isolated database (as should be, when testing). It appears that the Fully-functional Drupal at http://localhost.example is merely used as bootstrap for the web-tests.

Can I circumvent that bootstrap in some way?

And if not, what is a quick and easy way to get a Drupal installed and serving with as little dependencies (like Apache/Nginx, MySQL etc) as possible?

Also note that I am running Travis already for tagadelic, but so far, only for the phpunit tests. I want to extend this to run the DrupalWebTests there as well.

0

You could just use different git branches to isolate your code tests.

git checkout -b iss_tst1
<make changes>
git add <changes>
git commit -m "my new changes" <changes>

git checkout -b iss_tst2
<make changes>
git add <changes>
git commit -m "other new independent changes" <changes>

Then you should be able to run independent tests on each branch.

  • You cannot use git branches in automated testing like that, without severely cluttering the actual git-workwflow. TDD, test-driven development, means running the test -isoated- hundreds of times per day. – berkes Feb 24 '14 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.